Source for file toolbar.php

Documentation is available at toolbar.php

  1. <?php
  2. /**
  3.  * @package    Joomla.Administrator
  4.  *
  5.  * @copyright  Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  6.  * @license    GNU General Public License version 2 or later; see LICENSE.txt
  7.  */
  8.  
  9. defined('_JEXEC'or die;
  10.  
  11. /**
  12.  * Utility class for the button bar.
  13.  *
  14.  * @package  Joomla.Administrator
  15.  * @since    1.5
  16.  */
  17. abstract class JToolbarHelper
  18. {
  19.     /**
  20.      * Title cell.
  21.      * For the title and toolbar to be rendered correctly,
  22.      * this title fucntion must be called before the starttable function and the toolbars icons
  23.      * this is due to the nature of how the css has been used to postion the title in respect to the toolbar.
  24.      *
  25.      * @param   string  $title  The title.
  26.      * @param   string  $icon   The space-separated names of the image.
  27.      *
  28.      * @return  void 
  29.      *
  30.      * @since   1.5
  31.      */
  32.     public static function title($title$icon 'generic.png')
  33.     {
  34.         $layout new JLayoutFile('joomla.toolbar.title');
  35.         $html $layout->render(array('title' => $title'icon' => $icon));
  36.  
  37.         $app JFactory::getApplication();
  38.         $app->JComponentTitle $html;
  39.         JFactory::getDocument()->setTitle($app->getCfg('sitename'' - ' JText::_('JADMINISTRATION'' - ' $title);
  40.     }
  41.  
  42.     /**
  43.      * Writes a spacer cell.
  44.      *
  45.      * @param   string  $width  The width for the cell
  46.      *
  47.      * @return  void 
  48.      *
  49.      * @since   1.5
  50.      */
  51.     public static function spacer($width '')
  52.     {
  53.         $bar JToolbar::getInstance('toolbar');
  54.  
  55.         // Add a spacer.
  56.         $bar->appendButton('Separator''spacer'$width);
  57.     }
  58.  
  59.     /**
  60.      * Writes a divider between menu buttons
  61.      *
  62.      * @return  void 
  63.      *
  64.      * @since   1.5
  65.      */
  66.     public static function divider()
  67.     {
  68.         $bar JToolbar::getInstance('toolbar');
  69.  
  70.         // Add a divider.
  71.         $bar->appendButton('Separator''divider');
  72.     }
  73.  
  74.     /**
  75.      * Writes a custom option and task button for the button bar.
  76.      *
  77.      * @param   string  $task        The task to perform (picked up by the switch($task) blocks.
  78.      * @param   string  $icon        The image to display.
  79.      * @param   string  $iconOver    The image to display when moused over.
  80.      * @param   string  $alt         The alt text for the icon image.
  81.      * @param   bool    $listSelect  True if required to check that a standard list item is checked.
  82.      *
  83.      * @return  void 
  84.      *
  85.      * @since   1.5
  86.      */
  87.     public static function custom($task ''$icon ''$iconOver ''$alt ''$listSelect true)
  88.     {
  89.         $bar JToolbar::getInstance('toolbar');
  90.  
  91.         // Strip extension.
  92.         $icon preg_replace('#\.[^.]*$#'''$icon);
  93.  
  94.         // Add a standard button.
  95.         $bar->appendButton('Standard'$icon$alt$task$listSelect);
  96.     }
  97.  
  98.     /**
  99.      * Writes a preview button for a given option (opens a popup window).
  100.      *
  101.      * @param   string  $url            The name of the popup file (excluding the file extension)
  102.      * @param   bool    $updateEditors  Unused
  103.      *
  104.      * @return  void 
  105.      *
  106.      * @since   1.5
  107.      */
  108.     public static function preview($url ''$updateEditors false)
  109.     {
  110.         $bar JToolbar::getInstance('toolbar');
  111.  
  112.         // Add a preview button.
  113.         $bar->appendButton('Popup''preview''Preview'$url '&task=preview');
  114.     }
  115.  
  116.     /**
  117.      * Writes a preview button for a given option (opens a popup window).
  118.      *
  119.      * @param   string  $ref        The name of the popup file (excluding the file extension for an xml file).
  120.      * @param   bool    $com        Use the help file in the component directory.
  121.      * @param   string  $override   Use this URL instead of any other
  122.      * @param   string  $component  Name of component to get Help (null for current component)
  123.      *
  124.      * @return  void 
  125.      *
  126.      * @since   1.5
  127.      */
  128.     public static function help($ref$com false$override null$component null)
  129.     {
  130.         $bar JToolbar::getInstance('toolbar');
  131.  
  132.         // Add a help button.
  133.         $bar->appendButton('Help'$ref$com$override$component);
  134.     }
  135.  
  136.     /**
  137.      * Writes a cancel button that will go back to the previous page without doing
  138.      * any other operation.
  139.      *
  140.      * @param   string  $alt   Alternative text.
  141.      * @param   string  $href  URL of the href attribute.
  142.      *
  143.      * @return  void 
  144.      *
  145.      * @since   1.5
  146.      */
  147.     public static function back($alt 'JTOOLBAR_BACK'$href 'javascript:history.back();')
  148.     {
  149.         $bar JToolbar::getInstance('toolbar');
  150.  
  151.         // Add a back button.
  152.         $bar->appendButton('Link''back'$alt$href);
  153.     }
  154.  
  155.     /**
  156.      * Writes a media_manager button.
  157.      *
  158.      * @param   string  $directory  The sub-directory to upload the media to.
  159.      * @param   string  $alt        An override for the alt text.
  160.      *
  161.      * @return  void 
  162.      *
  163.      * @since   1.5
  164.      */
  165.     public static function media_manager($directory ''$alt 'JTOOLBAR_UPLOAD')
  166.     {
  167.         $bar JToolbar::getInstance('toolbar');
  168.  
  169.         // Add an upload button.
  170.         $bar->appendButton('Popup''upload'$alt'index.php?option=com_media&tmpl=component&task=popupUpload&folder=' $directory800520);
  171.     }
  172.  
  173.     /**
  174.      * Writes a common 'default' button for a record.
  175.      *
  176.      * @param   string  $task  An override for the task.
  177.      * @param   string  $alt   An override for the alt text.
  178.      *
  179.      * @return  void 
  180.      *
  181.      * @since   1.5
  182.      */
  183.     public static function makeDefault($task 'default'$alt 'JTOOLBAR_DEFAULT')
  184.     {
  185.         $bar JToolbar::getInstance('toolbar');
  186.  
  187.         // Add a default button.
  188.         $bar->appendButton('Standard''default'$alt$tasktrue);
  189.     }
  190.  
  191.     /**
  192.      * Writes a common 'assign' button for a record.
  193.      *
  194.      * @param   string  $task  An override for the task.
  195.      * @param   string  $alt   An override for the alt text.
  196.      *
  197.      * @return  void 
  198.      *
  199.      * @since   1.5
  200.      */
  201.     public static function assign($task 'assign'$alt 'JTOOLBAR_ASSIGN')
  202.     {
  203.         $bar JToolbar::getInstance('toolbar');
  204.  
  205.         // Add an assign button.
  206.         $bar->appendButton('Standard''assign'$alt$tasktrue);
  207.     }
  208.  
  209.     /**
  210.      * Writes the common 'new' icon for the button bar.
  211.      *
  212.      * @param   string   $task   An override for the task.
  213.      * @param   string   $alt    An override for the alt text.
  214.      * @param   boolean  $check  True if required to check that a standard list item is checked.
  215.      *
  216.      * @return  void 
  217.      *
  218.      * @since   1.5
  219.      */
  220.     public static function addNew($task 'add'$alt 'JTOOLBAR_NEW'$check false)
  221.     {
  222.         $bar JToolbar::getInstance('toolbar');
  223.  
  224.         // Add a new button.
  225.         $bar->appendButton('Standard''new'$alt$task$check);
  226.     }
  227.  
  228.     /**
  229.      * Writes a common 'publish' button.
  230.      *
  231.      * @param   string   $task   An override for the task.
  232.      * @param   string   $alt    An override for the alt text.
  233.      * @param   boolean  $check  True if required to check that a standard list item is checked.
  234.      *
  235.      * @return  void 
  236.      *
  237.      * @since   1.5
  238.      */
  239.     public static function publish($task 'publish'$alt 'JTOOLBAR_PUBLISH'$check false)
  240.     {
  241.         $bar JToolbar::getInstance('toolbar');
  242.  
  243.         // Add a publish button.
  244.         $bar->appendButton('Standard''publish'$alt$task$check);
  245.     }
  246.  
  247.     /**
  248.      * Writes a common 'publish' button for a list of records.
  249.      *
  250.      * @param   string  $task  An override for the task.
  251.      * @param   string  $alt   An override for the alt text.
  252.      *
  253.      * @return  void 
  254.      *
  255.      * @since   1.5
  256.      */
  257.     public static function publishList($task 'publish'$alt 'JTOOLBAR_PUBLISH')
  258.     {
  259.         $bar JToolbar::getInstance('toolbar');
  260.  
  261.         // Add a publish button (list).
  262.         $bar->appendButton('Standard''publish'$alt$tasktrue);
  263.     }
  264.  
  265.     /**
  266.      * Writes a common 'unpublish' button.
  267.      *
  268.      * @param   string   $task   An override for the task.
  269.      * @param   string   $alt    An override for the alt text.
  270.      * @param   boolean  $check  True if required to check that a standard list item is checked.
  271.      *
  272.      * @return  void 
  273.      *
  274.      * @since   1.5
  275.      */
  276.     public static function unpublish($task 'unpublish'$alt 'JTOOLBAR_UNPUBLISH'$check false)
  277.     {
  278.         $bar JToolbar::getInstance('toolbar');
  279.  
  280.         // Add an unpublish button
  281.         $bar->appendButton('Standard''unpublish'$alt$task$check);
  282.     }
  283.  
  284.     /**
  285.      * Writes a common 'unpublish' button for a list of records.
  286.      *
  287.      * @param   string  $task  An override for the task.
  288.      * @param   string  $alt   An override for the alt text.
  289.      *
  290.      * @return  void 
  291.      *
  292.      * @since   1.5
  293.      */
  294.     public static function unpublishList($task 'unpublish'$alt 'JTOOLBAR_UNPUBLISH')
  295.     {
  296.         $bar JToolbar::getInstance('toolbar');
  297.  
  298.         // Add an unpublish button (list).
  299.         $bar->appendButton('Standard''unpublish'$alt$tasktrue);
  300.     }
  301.  
  302.     /**
  303.      * Writes a common 'archive' button for a list of records.
  304.      *
  305.      * @param   string  $task  An override for the task.
  306.      * @param   string  $alt   An override for the alt text.
  307.      *
  308.      * @return  void 
  309.      *
  310.      * @since   1.5
  311.      */
  312.     public static function archiveList($task 'archive'$alt 'JTOOLBAR_ARCHIVE')
  313.     {
  314.         $bar JToolbar::getInstance('toolbar');
  315.  
  316.         // Add an archive button.
  317.         $bar->appendButton('Standard''archive'$alt$tasktrue);
  318.     }
  319.  
  320.     /**
  321.      * Writes an unarchive button for a list of records.
  322.      *
  323.      * @param   string  $task  An override for the task.
  324.      * @param   string  $alt   An override for the alt text.
  325.      *
  326.      * @return  void 
  327.      *
  328.      * @since   1.5
  329.      */
  330.     public static function unarchiveList($task 'unarchive'$alt 'JTOOLBAR_UNARCHIVE')
  331.     {
  332.         $bar JToolbar::getInstance('toolbar');
  333.  
  334.         // Add an unarchive button (list).
  335.         $bar->appendButton('Standard''unarchive'$alt$tasktrue);
  336.     }
  337.  
  338.     /**
  339.      * Writes a common 'edit' button for a list of records.
  340.      *
  341.      * @param   string  $task  An override for the task.
  342.      * @param   string  $alt   An override for the alt text.
  343.      *
  344.      * @return  void 
  345.      *
  346.      * @since   1.5
  347.      */
  348.     public static function editList($task 'edit'$alt 'JTOOLBAR_EDIT')
  349.     {
  350.         $bar JToolbar::getInstance('toolbar');
  351.  
  352.         // Add an edit button.
  353.         $bar->appendButton('Standard''edit'$alt$tasktrue);
  354.     }
  355.  
  356.     /**
  357.      * Writes a common 'edit' button for a template html.
  358.      *
  359.      * @param   string  $task  An override for the task.
  360.      * @param   string  $alt   An override for the alt text.
  361.      *
  362.      * @return  void 
  363.      *
  364.      * @since   1.5
  365.      */
  366.     public static function editHtml($task 'edit_source'$alt 'JTOOLBAR_EDIT_HTML')
  367.     {
  368.         $bar JToolbar::getInstance('toolbar');
  369.  
  370.         // Add an edit html button.
  371.         $bar->appendButton('Standard''edithtml'$alt$tasktrue);
  372.     }
  373.  
  374.     /**
  375.      * Writes a common 'edit' button for a template css.
  376.      *
  377.      * @param   string  $task  An override for the task.
  378.      * @param   string  $alt   An override for the alt text.
  379.      *
  380.      * @return  void 
  381.      *
  382.      * @since   1.5
  383.      */
  384.     public static function editCss($task 'edit_css'$alt 'JTOOLBAR_EDIT_CSS')
  385.     {
  386.         $bar JToolbar::getInstance('toolbar');
  387.  
  388.         // Add an edit css button (hide).
  389.         $bar->appendButton('Standard''editcss'$alt$tasktrue);
  390.     }
  391.  
  392.     /**
  393.      * Writes a common 'delete' button for a list of records.
  394.      *
  395.      * @param   string  $msg   Postscript for the 'are you sure' message.
  396.      * @param   string  $task  An override for the task.
  397.      * @param   string  $alt   An override for the alt text.
  398.      *
  399.      * @return  void 
  400.      *
  401.      * @since   1.5
  402.      */
  403.     public static function deleteList($msg ''$task 'remove'$alt 'JTOOLBAR_DELETE')
  404.     {
  405.         $bar JToolbar::getInstance('toolbar');
  406.  
  407.         // Add a delete button.
  408.         if ($msg)
  409.         {
  410.             $bar->appendButton('Confirm'$msg'delete'$alt$tasktrue);
  411.         }
  412.         else
  413.         {
  414.             $bar->appendButton('Standard''delete'$alt$tasktrue);
  415.         }
  416.     }
  417.  
  418.     /**
  419.      * Writes a common 'trash' button for a list of records.
  420.      *
  421.      * @param   string  $task   An override for the task.
  422.      * @param   string  $alt    An override for the alt text.
  423.      * @param   bool    $check  True to allow lists.
  424.      *
  425.      * @return  void 
  426.      *
  427.      * @since   1.5
  428.      */
  429.     public static function trash($task 'remove'$alt 'JTOOLBAR_TRASH'$check true)
  430.     {
  431.         $bar JToolbar::getInstance('toolbar');
  432.  
  433.         // Add a trash button.
  434.         $bar->appendButton('Standard''trash'$alt$task$checkfalse);
  435.     }
  436.  
  437.     /**
  438.      * Writes a save button for a given option.
  439.      * Apply operation leads to a save action only (does not leave edit mode).
  440.      *
  441.      * @param   string  $task  An override for the task.
  442.      * @param   string  $alt   An override for the alt text.
  443.      *
  444.      * @return  void 
  445.      *
  446.      * @since   1.5
  447.      */
  448.     public static function apply($task 'apply'$alt 'JTOOLBAR_APPLY')
  449.     {
  450.         $bar JToolbar::getInstance('toolbar');
  451.  
  452.         // Add an apply button
  453.         $bar->appendButton('Standard''apply'$alt$taskfalse);
  454.     }
  455.  
  456.     /**
  457.      * Writes a save button for a given option.
  458.      * Save operation leads to a save and then close action.
  459.      *
  460.      * @param   string  $task  An override for the task.
  461.      * @param   string  $alt   An override for the alt text.
  462.      *
  463.      * @return  void 
  464.      *
  465.      * @since   1.5
  466.      */
  467.     public static function save($task 'save'$alt 'JTOOLBAR_SAVE')
  468.     {
  469.         $bar JToolbar::getInstance('toolbar');
  470.  
  471.         // Add a save button.
  472.         $bar->appendButton('Standard''save'$alt$taskfalse);
  473.     }
  474.  
  475.     /**
  476.      * Writes a save and create new button for a given option.
  477.      * Save and create operation leads to a save and then add action.
  478.      *
  479.      * @param   string  $task  An override for the task.
  480.      * @param   string  $alt   An override for the alt text.
  481.      *
  482.      * @return  void 
  483.      *
  484.      * @since   1.6
  485.      */
  486.     public static function save2new($task 'save2new'$alt 'JTOOLBAR_SAVE_AND_NEW')
  487.     {
  488.         $bar JToolbar::getInstance('toolbar');
  489.  
  490.         // Add a save and create new button.
  491.         $bar->appendButton('Standard''save-new'$alt$taskfalse);
  492.     }
  493.  
  494.     /**
  495.      * Writes a save as copy button for a given option.
  496.      * Save as copy operation leads to a save after clearing the key,
  497.      * then returns user to edit mode with new key.
  498.      *
  499.      * @param   string  $task  An override for the task.
  500.      * @param   string  $alt   An override for the alt text.
  501.      *
  502.      * @return  void 
  503.      *
  504.      * @since   1.6
  505.      */
  506.     public static function save2copy($task 'save2copy'$alt 'JTOOLBAR_SAVE_AS_COPY')
  507.     {
  508.         $bar JToolbar::getInstance('toolbar');
  509.  
  510.         // Add a save and create new button.
  511.         $bar->appendButton('Standard''save-copy'$alt$taskfalse);
  512.     }
  513.  
  514.     /**
  515.      * Writes a checkin button for a given option.
  516.      *
  517.      * @param   string   $task   An override for the task.
  518.      * @param   string   $alt    An override for the alt text.
  519.      * @param   boolean  $check  True if required to check that a standard list item is checked.
  520.      *
  521.      * @return  void 
  522.      *
  523.      * @since   1.7
  524.      */
  525.     public static function checkin($task 'checkin'$alt 'JTOOLBAR_CHECKIN'$check true)
  526.     {
  527.         $bar JToolbar::getInstance('toolbar');
  528.  
  529.         // Add a save and create new button.
  530.         $bar->appendButton('Standard''checkin'$alt$task$check);
  531.     }
  532.  
  533.     /**
  534.      * Writes a cancel button and invokes a cancel operation (eg a checkin).
  535.      *
  536.      * @param   string  $task  An override for the task.
  537.      * @param   string  $alt   An override for the alt text.
  538.      *
  539.      * @return  void 
  540.      *
  541.      * @since   1.5
  542.      */
  543.     public static function cancel($task 'cancel'$alt 'JTOOLBAR_CANCEL')
  544.     {
  545.         $bar JToolbar::getInstance('toolbar');
  546.  
  547.         // Add a cancel button.
  548.         $bar->appendButton('Standard''cancel'$alt$taskfalse);
  549.     }
  550.  
  551.     /**
  552.      * Writes a configuration button and invokes a cancel operation (eg a checkin).
  553.      *
  554.      * @param   string   $component  The name of the component, eg, com_content.
  555.      * @param   integer  $height     The height of the popup. [UNUSED]
  556.      * @param   integer  $width      The width of the popup. [UNUSED]
  557.      * @param   string   $alt        The name of the button.
  558.      * @param   string   $path       An alternative path for the configuation xml relative to JPATH_SITE.
  559.      *
  560.      * @return  void 
  561.      *
  562.      * @since   1.5
  563.      */
  564.     public static function preferences($component$height '550'$width '875'$alt 'JToolbar_Options'$path '')
  565.     {
  566.         $component urlencode($component);
  567.         $path urlencode($path);
  568.         $bar JToolBar::getInstance('toolbar');
  569.  
  570.         $uri = (string) JUri::getInstance();
  571.         $return urlencode(base64_encode($uri));
  572.  
  573.         // Add a button linking to config for component.
  574.         $bar->appendButton(
  575.             'Link',
  576.             'options',
  577.             $alt,
  578.             'index.php?option=com_config&amp;view=component&amp;component=' $component '&amp;path=' $path '&amp;return=' $return
  579.         );
  580.     }
  581.  
  582.     /**
  583.      * Writes a version history
  584.      *
  585.      * @param   string   $typeAlias  The component and type, for example 'com_content.article'
  586.      * @param   integer  $itemId     The id of the item, for example the article id.
  587.      * @param   integer  $height     The height of the popup.
  588.      * @param   integer  $width      The width of the popup.
  589.      * @param   string   $alt        The name of the button.
  590.      *
  591.      * @return  void 
  592.      *
  593.      * @since   3.2
  594.      */
  595.     public static function versions($typeAlias$itemId$height 800$width 500$alt 'JTOOLBAR_VERSIONS')
  596.     {
  597.         JHtml::_('behavior.modal''a.modal_jform_contenthistory');
  598.  
  599.         $contentTypeTable JTable::getInstance('Contenttype');
  600.         $typeId           $contentTypeTable->getTypeId($typeAlias);
  601.  
  602.         // Options array for JLayout
  603.         $options              array();
  604.         $options['title']     JText::_($alt);
  605.         $options['height']    $height;
  606.         $options['width']     $width;
  607.         $options['itemId']    $itemId;
  608.         $options['typeId']    $typeId;
  609.         $options['typeAlias'$typeAlias;
  610.  
  611.         $bar    JToolbar::getInstance('toolbar');
  612.         $layout new JLayoutFile('joomla.toolbar.versions');
  613.         $bar->appendButton('Custom'$layout->render($options)'versions');
  614.     }
  615.  
  616.     /**
  617.      * Displays a modal button
  618.      *
  619.      * @param   string  $targetModalId  ID of the target modal box
  620.      * @param   string  $icon           Icon class to show on modal button
  621.      * @param   string  $alt            Title for the modal button
  622.      *
  623.      * @return  void 
  624.      *
  625.      * @since   3.2
  626.      */
  627.     public static function modal($targetModalId$icon$alt)
  628.     {
  629.         JHtml::_('behavior.modal');
  630.         $title JText::_($alt);
  631.         $dhtml "<button data-toggle='modal' data-target='#" $targetModalId "' class='btn btn-small'>
  632.             <i class='" $icon "' title='" $title "'></i>" $title "</button>";
  633.  
  634.         $bar JToolbar::getInstance('toolbar');
  635.         $bar->appendButton('Custom'$dhtml$alt);
  636.     }
  637. }
  638.  
  639. /**
  640.  * Utility class for the submenu.
  641.  *
  642.  * @package     Joomla.Administrator
  643.  * @since       1.5
  644.  * @deprecated  4.0  Use JHtmlSidebar instead.
  645.  */
  646. abstract class JSubMenuHelper
  647. {
  648.     /**
  649.      * Menu entries
  650.      *
  651.      * @var    array 
  652.      * @since  3.0
  653.      * @deprecated  4.0
  654.      */
  655.     protected static $entries array();
  656.  
  657.     /**
  658.      * Filters
  659.      *
  660.      * @var    array 
  661.      * @since  3.0
  662.      * @deprecated  4.0
  663.      */
  664.     protected static $filters array();
  665.  
  666.     /**
  667.      * Value for the action attribute of the form.
  668.      *
  669.      * @var    string 
  670.      * @since  3.0
  671.      * @deprecated  4.0
  672.      */
  673.     protected static $action '';
  674.  
  675.     /**
  676.      * Method to add a menu item to submenu.
  677.      *
  678.      * @param   string   $name    Name of the menu item.
  679.      * @param   string   $link    URL of the menu item.
  680.      * @param   boolean  $active  True if the item is active, false otherwise.
  681.      *
  682.      * @return  void 
  683.      *
  684.      * @since   1.5
  685.      * @deprecated  4.0  Use JHtmlSidebar::addEntry() instead.
  686.      */
  687.     public static function addEntry($name$link ''$active false)
  688.     {
  689.         JLog::add('JSubMenuHelper::addEntry() is deprecated. Use JHtmlSidebar::addEntry() instead.'JLog::WARNING'deprecated');
  690.         array_push(self::$entriesarray($name$link$active));
  691.     }
  692.  
  693.     /**
  694.      * Returns an array of all submenu entries
  695.      *
  696.      * @return  array 
  697.      *
  698.      * @since   3.0
  699.      * @deprecated  4.0  Use JHtmlSidebar::getEntries() instead.
  700.      */
  701.     public static function getEntries()
  702.     {
  703.         JLog::add('JSubMenuHelper::getEntries() is deprecated. Use JHtmlSidebar::getEntries() instead.'JLog::WARNING'deprecated');
  704.         return self::$entries;
  705.     }
  706.  
  707.     /**
  708.      * Method to add a filter to the submenu
  709.      *
  710.      * @param   string   $label      Label for the menu item.
  711.      * @param   string   $name       name for the filter. Also used as id.
  712.      * @param   string   $options    options for the select field.
  713.      * @param   boolean  $noDefault  Don't the label as the empty option
  714.      *
  715.      * @return  void 
  716.      *
  717.      * @since   3.0
  718.      * @deprecated  4.0  Use JHtmlSidebar::addFilter() instead.
  719.      */
  720.     public static function addFilter($label$name$options$noDefault false)
  721.     {
  722.         JLog::add('JSubMenuHelper::addFilter() is deprecated. Use JHtmlSidebar::addFilter() instead.'JLog::WARNING'deprecated');
  723.         array_push(self::$filtersarray('label' => $label'name' => $name'options' => $options'noDefault' => $noDefault));
  724.     }
  725.  
  726.     /**
  727.      * Returns an array of all filters
  728.      *
  729.      * @return  array 
  730.      *
  731.      * @since   3.0
  732.      * @deprecated  4.0  Use JHtmlSidebar::getFilters() instead.
  733.      */
  734.     public static function getFilters()
  735.     {
  736.         JLog::add('JSubMenuHelper::getFilters() is deprecated. Use JHtmlSidebar::getFilters() instead.'JLog::WARNING'deprecated');
  737.         return self::$filters;
  738.     }
  739.  
  740.     /**
  741.      * Set value for the action attribute of the filter form
  742.      *
  743.      * @param   string  $action  Value for the action attribute of the form
  744.      *
  745.      * @return  void 
  746.      *
  747.      * @since   3.0
  748.      * @deprecated  4.0  Use JHtmlSidebar::setAction() instead.
  749.      */
  750.     public static function setAction($action)
  751.     {
  752.         JLog::add('JSubMenuHelper::setAction() is deprecated. Use JHtmlSidebar::setAction() instead.'JLog::WARNING'deprecated');
  753.         self::$action $action;
  754.     }
  755.  
  756.     /**
  757.      * Get value for the action attribute of the filter form
  758.      *
  759.      * @return  string  Value for the action attribute of the form
  760.      *
  761.      * @since   3.0
  762.      * @deprecated  4.0  Use JHtmlSidebar::getAction() instead.
  763.      */
  764.     public static function getAction()
  765.     {
  766.         JLog::add('JSubMenuHelper::getAction() is deprecated. Use JHtmlSidebar::getAction() instead.'JLog::WARNING'deprecated');
  767.         return self::$action;
  768.     }
  769. }

Documentation generated on Tue, 19 Nov 2013 15:15:54 +0100 by phpDocumentor 1.4.3