PageRenderTime 15ms CodeModel.GetById 13ms app.highlight 1ms RepoModel.GetById 0ms app.codeStats 0ms

/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
Possible License(s): LGPL-2.1
 1<?php
 2/**
 3 * @package     Joomla.Administrator
 4 * @subpackage  com_content
 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
10defined('_JEXEC') or die;
11
12/**
13 * @package     Joomla.Administrator
14 * @subpackage  com_content
15 */
16abstract class JHtmlContentAdministrator
17{
18	/**
19	 * @param	int $value	The state value
20	 * @param	int $i
21	 */
22	public static function featured($value = 0, $i, $canChange = true)
23	{
24		// Array of image, task, title, action
25		$states	= array(
26			0	=> array('star-empty',	'articles.featured',	'COM_CONTENT_UNFEATURED',	'COM_CONTENT_TOGGLE_TO_FEATURE'),
27			1	=> array('star',		'articles.unfeatured',	'COM_CONTENT_FEATURED',		'COM_CONTENT_TOGGLE_TO_UNFEATURE'),
28		);
29		$state	= JArrayHelper::getValue($states, (int) $value, $states[1]);
30		$icon	= $state[0];
31		if ($canChange) {
32			$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-'
33					. $icon.'"></i></a>';
34		}
35
36		return $html;
37	}
38}