| [ Index ] |
PHP Cross Reference of Joomla 1.5.26 DE |
[Summary view] [Print] [Text view]
1 <?php 2 /** 3 * @version $Id: view.html.php 14401 2010-01-26 14:10:00Z louis $ 4 * @package Joomla 5 * @subpackage Config 6 * @copyright Copyright (C) 2005 - 2010 Open Source Matters. All rights reserved. 7 * @license GNU/GPL, see LICENSE.php 8 * Joomla! is free software. This version may have been modified pursuant 9 * to the GNU General Public License, and as distributed it includes or 10 * is derivative of works licensed under the GNU General Public License or 11 * other free or open source software licenses. 12 * See COPYRIGHT.php for copyright notices and details. 13 */ 14 15 // no direct access 16 defined( '_JEXEC' ) or die( 'Restricted access' ); 17 18 jimport( 'joomla.application.component.view'); 19 20 /** 21 * HTML View class for the Plugins component 22 * 23 * @static 24 * @package Joomla 25 * @subpackage Plugins 26 * @since 1.0 27 */ 28 class PluginsViewPlugin extends JView 29 { 30 function display( $tpl = null ) 31 { 32 global $option; 33 34 $db =& JFactory::getDBO(); 35 $user =& JFactory::getUser(); 36 37 $client = JRequest::getWord( 'client', 'site' ); 38 $cid = JRequest::getVar( 'cid', array(0), '', 'array' ); 39 JArrayHelper::toInteger($cid, array(0)); 40 41 $lists = array(); 42 $row =& JTable::getInstance('plugin'); 43 44 // load the row from the db table 45 $row->load( $cid[0] ); 46 47 // fail if checked out not by 'me' 48 49 if ($row->isCheckedOut( $user->get('id') )) 50 { 51 $msg = JText::sprintf( 'DESCBEINGEDITTED', JText::_( 'The plugin' ), $row->title ); 52 $this->setRedirect( 'index.php?option='. $option .'&client='. $client, $msg, 'error' ); 53 return false; 54 } 55 56 if ($client == 'admin') { 57 $where = "client_id='1'"; 58 } else { 59 $where = "client_id='0'"; 60 } 61 62 // get list of groups 63 if ($row->access == 99 || $row->client_id == 1) { 64 $lists['access'] = 'Administrator<input type="hidden" name="access" value="99" />'; 65 } else { 66 // build the html select list for the group access 67 $lists['access'] = JHTML::_('list.accesslevel', $row ); 68 } 69 70 if ($cid[0]) 71 { 72 $row->checkout( $user->get('id') ); 73 74 if ( $row->ordering > -10000 && $row->ordering < 10000 ) 75 { 76 // build the html select list for ordering 77 $query = 'SELECT ordering AS value, name AS text' 78 . ' FROM #__plugins' 79 . ' WHERE folder = '.$db->Quote($row->folder) 80 . ' AND published > 0' 81 . ' AND '. $where 82 . ' AND ordering > -10000' 83 . ' AND ordering < 10000' 84 . ' ORDER BY ordering' 85 ; 86 $order = JHTML::_('list.genericordering', $query ); 87 $lists['ordering'] = JHTML::_('select.genericlist', $order, 'ordering', 'class="inputbox" size="1"', 'value', 'text', intval( $row->ordering ) ); 88 } else { 89 $lists['ordering'] = '<input type="hidden" name="ordering" value="'. $row->ordering .'" />'. JText::_( 'This plugin cannot be reordered' ); 90 } 91 92 $lang =& JFactory::getLanguage(); 93 $lang->load( 'plg_' . trim( $row->folder ) . '_' . trim( $row->element ), JPATH_ADMINISTRATOR ); 94 95 $data = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . 'plugins'. DS .$row->folder . DS . $row->element .'.xml'); 96 97 $row->description = $data['description']; 98 99 } else { 100 $row->folder = ''; 101 $row->ordering = 999; 102 $row->published = 1; 103 $row->description = ''; 104 } 105 106 $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ); 107 108 // get params definitions 109 $params = new JParameter( $row->params, JApplicationHelper::getPath( 'plg_xml', $row->folder.DS.$row->element ), 'plugin' ); 110 111 $this->assignRef('lists', $lists); 112 $this->assignRef('plugin', $row); 113 $this->assignRef('params', $params); 114 115 parent::display($tpl); 116 } 117 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Wed Mar 28 15:54:07 2012 | Cross-referenced by PHPXref 0.7.1 |