Source for file batch.php

Documentation is available at batch.php

  1. <?php
  2. /**
  3.  * @package     Joomla.Libraries
  4.  * @subpackage  HTML
  5.  *
  6.  * @copyright   Copyright (C) 2005 - 2013 Open Source Matters, Inc. All rights reserved.
  7.  * @license     GNU General Public License version 2 or later; see LICENSE
  8.  */
  9.  
  10. defined('JPATH_BASE'or die;
  11.  
  12. /**
  13.  * Extended Utility class for batch processing widgets.
  14.  *
  15.  * @package     Joomla.Libraries
  16.  * @subpackage  HTML
  17.  * @since       1.7
  18.  */
  19. abstract class JHtmlBatch
  20. {
  21.     /**
  22.      * Display a batch widget for the access level selector.
  23.      *
  24.      * @return  string  The necessary HTML for the widget.
  25.      *
  26.      * @since   1.7
  27.      */
  28.     public static function access()
  29.     {
  30.         JHtml::_('bootstrap.tooltip');
  31.  
  32.         // Create the batch selector to change an access level on a selection list.
  33.         return
  34.             '<label id="batch-access-lbl" for="batch-access" class="hasToolip"'
  35.             . 'title="' JHtml::tooltipText('JLIB_HTML_BATCH_ACCESS_LABEL''JLIB_HTML_BATCH_ACCESS_LABEL_DESC''">'
  36.             . JText::_('JLIB_HTML_BATCH_ACCESS_LABEL')
  37.             . '</label>'
  38.             . JHtml::_(
  39.                 'access.assetgrouplist',
  40.                 'batch[assetgroup_id]''',
  41.                 'class="inputbox"',
  42.                 array(
  43.                     'title' => JText::_('JLIB_HTML_BATCH_NOCHANGE'),
  44.                     'id' => 'batch-access'
  45.                 )
  46.             );
  47.  
  48.         return implode("\n"$lines);
  49.     }
  50.  
  51.     /**
  52.      * Displays a batch widget for moving or copying items.
  53.      *
  54.      * @param   string  $extension  The extension that owns the category.
  55.      *
  56.      * @return  string  The necessary HTML for the widget.
  57.      *
  58.      * @since   1.7
  59.      */
  60.     public static function item($extension)
  61.     {
  62.         // Create the copy/move options.
  63.         $options array(
  64.             JHtml::_('select.option''c'JText::_('JLIB_HTML_BATCH_COPY')),
  65.             JHtml::_('select.option''m'JText::_('JLIB_HTML_BATCH_MOVE'))
  66.         );
  67.  
  68.         // Create the batch selector to change select the category by which to move or copy.
  69.         return
  70.             '<label id="batch-choose-action-lbl" for="batch-choose-action">' JText::_('JLIB_HTML_BATCH_MENU_LABEL''</label>'
  71.             . '<div id="batch-choose-action" class="control-group">'
  72.             . '<select name="batch[category_id]" class="inputbox" id="batch-category-id">'
  73.             . '<option value="">' JText::_('JSELECT''</option>'
  74.             . JHtml::_('select.options'JHtml::_('category.options'$extension))
  75.             . '</select>'
  76.             . '</div>'
  77.             . '<div id="batch-move-copy" class="control-group radio">'
  78.             . JHtml::_('select.radiolist'$options'batch[move_copy]''''value''text''m')
  79.             . '</div><hr />';
  80.     }
  81.  
  82.     /**
  83.      * Display a batch widget for the language selector.
  84.      *
  85.      * @return  string  The necessary HTML for the widget.
  86.      *
  87.      * @since   2.5
  88.      */
  89.     public static function language()
  90.     {
  91.         JHtml::_('bootstrap.tooltip');
  92.  
  93.         // Create the batch selector to change the language on a selection list.
  94.         return
  95.             '<label id="batch-language-lbl" for="batch-language-id" class="hasToolip"'
  96.             . ' title="' JHtml::tooltipText('JLIB_HTML_BATCH_LANGUAGE_LABEL''JLIB_HTML_BATCH_LANGUAGE_LABEL_DESC''">'
  97.             . JText::_('JLIB_HTML_BATCH_LANGUAGE_LABEL')
  98.             . '</label>'
  99.             . '<select name="batch[language_id]" class="inputbox" id="batch-language-id">'
  100.             . '<option value="">' JText::_('JLIB_HTML_BATCH_LANGUAGE_NOCHANGE''</option>'
  101.             . JHtml::_('select.options'JHtml::_('contentlanguage.existing'truetrue)'value''text')
  102.             . '</select>';
  103.     }
  104.  
  105.     /**
  106.      * Display a batch widget for the user selector.
  107.      *
  108.      * @param   boolean  $noUser  Choose to display a "no user" option
  109.      *
  110.      * @return  string  The necessary HTML for the widget.
  111.      *
  112.      * @since   2.5
  113.      */
  114.     public static function user($noUser true)
  115.     {
  116.         JHtml::_('bootstrap.tooltip');
  117.  
  118.         $optionNo '';
  119.         if ($noUser)
  120.         {
  121.             $optionNo '<option value="0">' JText::_('JLIB_HTML_BATCH_USER_NOUSER''</option>';
  122.         }
  123.  
  124.         // Create the batch selector to select a user on a selection list.
  125.         return
  126.             '<label id="batch-user-lbl" for="batch-user" class="hasTooltip"'
  127.             . ' title="' JHtml::tooltipText('JLIB_HTML_BATCH_USER_LABEL''JLIB_HTML_BATCH_USER_LABEL_DESC''">'
  128.             . JText::_('JLIB_HTML_BATCH_USER_LABEL')
  129.             . '</label>'
  130.             . '<select name="batch[user_id]" class="inputbox" id="batch-user-id">'
  131.             . '<option value="">' JText::_('JLIB_HTML_BATCH_USER_NOCHANGE''</option>'
  132.             . $optionNo
  133.             . JHtml::_('select.options'JHtml::_('user.userlist')'value''text')
  134.             . '</select>';
  135.     }
  136.  
  137.     /**
  138.      * Display a batch widget for the tag selector.
  139.      *
  140.      * @return  string  The necessary HTML for the widget.
  141.      *
  142.      * @since   3.1
  143.      */
  144.     public static function tag()
  145.     {
  146.         JHtml::_('bootstrap.tooltip');
  147.  
  148.         // Create the batch selector to tag items on a selection list.
  149.         return
  150.             '<label id="batch-tag-lbl" for="batch-tag-id" class="hasTooltip"'
  151.             . ' title="' JHtml::tooltipText('JLIB_HTML_BATCH_TAG_LABEL''JLIB_HTML_BATCH_TAG_LABEL_DESC''">'
  152.             . JText::_('JLIB_HTML_BATCH_TAG_LABEL')
  153.             . '</label>'
  154.             . '<select name="batch[tag]" class="inputbox" id="batch-tag-id">'
  155.             . '<option value="">' JText::_('JLIB_HTML_BATCH_TAG_NOCHANGE''</option>'
  156.             . JHtml::_('select.options'JHtml::_('tag.tags'array('filter.published' => array(1)))'value''text')
  157.             . '</select>';
  158.     }
  159. }

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