| [ Index ] |
PHP Cross Reference of Joomla 2.5.4 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @copyright Copyright (C) 2005 - 2012 Open Source Matters, Inc. All rights reserved. 4 * @license GNU General Public License version 2 or later; see LICENSE.txt 5 */ 6 7 // No direct access. 8 defined('_JEXEC') or die; 9 10 /** 11 * Redirect component helper. 12 * 13 * @package Joomla.Administrator 14 * @subpackage com_redirect 15 * @since 1.6 16 */ 17 class RedirectHelper 18 { 19 public static $extension = 'com_redirect'; 20 21 /** 22 * Configure the Linkbar. 23 * 24 * @param string The name of the active view. 25 */ 26 public static function addSubmenu($vName) 27 { 28 // No submenu for this component. 29 } 30 31 /** 32 * Gets a list of the actions that can be performed. 33 * 34 * @return JObject 35 */ 36 public static function getActions() 37 { 38 $user = JFactory::getUser(); 39 $result = new JObject; 40 $assetName = 'com_redirect'; 41 42 $actions = array( 43 'core.admin', 'core.manage', 'core.create', 'core.edit', 'core.edit.state', 'core.delete' 44 ); 45 46 foreach ($actions as $action) { 47 $result->set($action, $user->authorise($action, $assetName)); 48 } 49 50 return $result; 51 } 52 53 /** 54 * Returns an array of standard published state filter options. 55 * 56 * @return string The HTML code for the select tag 57 */ 58 public static function publishedOptions() 59 { 60 // Build the active state filter options. 61 $options = array(); 62 $options[] = JHtml::_('select.option', '*', 'JALL'); 63 $options[] = JHtml::_('select.option', '1', 'JENABLED'); 64 $options[] = JHtml::_('select.option', '0', 'JDISABLED'); 65 $options[] = JHtml::_('select.option', '2', 'JARCHIVED'); 66 $options[] = JHtml::_('select.option', '-2', 'JTRASHED'); 67 68 return $options; 69 } 70 71 /** 72 * Determines if the plugin for Redirect to work is enabled. 73 * 74 * @return boolean 75 */ 76 public static function isEnabled() 77 { 78 $db = JFactory::getDbo(); 79 $db->setQuery( 80 'SELECT enabled' . 81 ' FROM #__extensions' . 82 ' WHERE folder = '.$db->quote('system'). 83 ' AND element = '.$db->quote('redirect') 84 ); 85 $result = (boolean) $db->loadResult(); 86 if ($error = $db->getErrorMsg()) { 87 JError::raiseWarning(500, $error); 88 } 89 return $result; 90 } 91 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Tue Apr 3 11:40:28 2012 | Cross-referenced by PHPXref 0.7.1 |