[ Index ]

PHP Cross Reference of Joomla 2.5.4 DE

title

Body

[close]

/administrator/components/com_banners/helpers/html/ -> banner.php (source)

   1  <?php
   2  /**
   3   * @package     Joomla.Administrator
   4   * @subpackage  com_banners
   5   *
   6   * @copyright   Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
   7   * @license     GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  defined('JPATH_BASE') or die;
  11  
  12  /**
  13   * Banner HTML class.
  14   *
  15   * @package     Joomla.Administrator
  16   * @subpackage  com_banners
  17   * @since       2.5
  18   */
  19  abstract class JHtmlBanner
  20  {
  21      /**
  22       * Display a batch widget for the client selector.
  23       *
  24       * @return  string  The necessary HTML for the widget.
  25       *
  26       * @since   2.5
  27       */
  28  	public static function clients()
  29      {
  30          // Create the batch selector to change the client on a selection list.
  31          $lines = array(
  32              '<label id="batch-client-lbl" for="batch-client" class="hasTip" title="'.JText::_('COM_BANNERS_BATCH_CLIENT_LABEL').'::'.JText::_('COM_BANNERS_BATCH_CLIENT_LABEL_DESC').'">',
  33              JText::_('COM_BANNERS_BATCH_CLIENT_LABEL'),
  34              '</label>',
  35              '<select name="batch[client_id]" class="inputbox" id="batch-client-id">',
  36              '<option value="">'.JText::_('COM_BANNERS_BATCH_CLIENT_NOCHANGE').'</option>',
  37              '<option value="0">'.JText::_('COM_BANNERS_NO_CLIENT').'</option>',
  38              JHtml::_('select.options', self::clientlist(), 'value', 'text'),
  39              '</select>'
  40          );
  41  
  42          return implode("\n", $lines);
  43      }
  44  
  45      /**
  46       * Method to get the field options.
  47       *
  48       * @return    array    The field option objects.
  49       * @since    1.6
  50       */
  51  	public static function clientlist()
  52      {
  53          $db        = JFactory::getDbo();
  54          $query    = $db->getQuery(true);
  55  
  56          $query->select('id As value, name As text');
  57          $query->from('#__banner_clients AS a');
  58          $query->order('a.name');
  59  
  60          // Get the options.
  61          $db->setQuery($query);
  62  
  63          $options = $db->loadObjectList();
  64  
  65          // Check for a database error.
  66          if ($db->getErrorNum()) {
  67              JError::raiseWarning(500, $db->getErrorMsg());
  68          }
  69  
  70          return $options;
  71      }
  72  }


Generated: Tue Apr 3 11:40:28 2012 Cross-referenced by PHPXref 0.7.1