/administrator/components/com_content/helpers/html/contentadministrator.php
https://bitbucket.org/eternaware/joomus · PHP · 38 lines · 19 code · 3 blank · 16 comment · 2 complexity · 02eef1338dbab7358ca960072c62b911 MD5 · raw file
- <?php
- /**
- * @package Joomla.Administrator
- * @subpackage com_content
- *
- * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved.
- * @license GNU General Public License version 2 or later; see LICENSE.txt
- */
- defined('_JEXEC') or die;
- /**
- * @package Joomla.Administrator
- * @subpackage com_content
- */
- abstract class JHtmlContentAdministrator
- {
- /**
- * @param int $value The state value
- * @param int $i
- */
- public static function featured($value = 0, $i, $canChange = true)
- {
- // Array of image, task, title, action
- $states = array(
- 0 => array('star-empty', 'articles.featured', 'COM_CONTENT_UNFEATURED', 'COM_CONTENT_TOGGLE_TO_FEATURE'),
- 1 => array('star', 'articles.unfeatured', 'COM_CONTENT_FEATURED', 'COM_CONTENT_TOGGLE_TO_UNFEATURE'),
- );
- $state = JArrayHelper::getValue($states, (int) $value, $states[1]);
- $icon = $state[0];
- if ($canChange) {
- $html = '<a href="#" onclick="return listItemTask(\'cb'.$i.'\',\''.$state[1].'\')" class="btn btn-micro ' . ($value == 1 ? 'active' : '') . '" rel="tooltip" title="'.JText::_($state[3]).'"><i class="icon-'
- . $icon.'"></i></a>';
- }
- return $html;
- }
- }