Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- /**
- * @version Id: adminpowermenu.php $
- * @package Joomla
- * @subpackage Content
- * @copyright Copyright (C)2010-2012 codeboxr.com. All rights reserved.
- * @license GNU/GPL, http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
- * @Support Forum http://codeboxr.com/product/admin-power-menu-for-joomla
- */
- // no direct access
- defined( '_JEXEC' ) or die( 'Restricted access' );
- if(version_compare(JVERSION,'1.6.0','ge')) {
- jimport('joomla.form.formfield');
- class JFormFieldModposition extends JFormField {
- var $type = 'modposition';
- function getInput(){
- return JElementModposition::fetchElement($this->name, $this->value, $this->element, $this->options['control']);
- }
- }
- }
- class JElementModposition extends JElement
- {
- /**
- * Element name
- *
- * @access protected
- * @var string
- */
- var $_name = 'modposition';
- function fetchElement( $name, $value, &$node, $control_name ) {
- if (!defined ('CODEBOXR_MODPOS')) {
- define ('CODEBOXR_MODPOS', 1);
- //
- }
- //let's list the module positions
- //$client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
- $clientid = 0; // for home page
- $user =& JFactory::getUser();
- $db =& JFactory::getDBO();
- $query = 'SELECT m.position AS text, m.position AS value'
- . ' FROM #__modules as m'
- . ' WHERE m.client_id = '.(int) $clientid
- . ' GROUP BY m.position'
- . ' ORDER BY m.position'
- ;
- //$positions[] = JHTML::_('select.option', '0', '- '. JText::_( 'Select Position' ) .' -' );
- $db->setQuery( $query );
- //$positions = array();
- $positions = $db->loadObjectList();
- //var_dump($positions);
- //var_dump($positions);
- //$lists['position'] = JHTML::_('select.genericlist', $positions, 'filter_position', 'class="inputbox" size="1" onchange="this.form.submit()"', 'value', 'text', "$filter_position" );
- if(version_compare(JVERSION,'1.6.0','ge')) {
- $fieldName = $name.'[]';
- }
- else {
- $fieldName = $control_name.'['.$name.'][]';
- }
- //$doc->addScriptDeclaration($js);
- $output= JHTML::_('select.genericlist', $positions, $fieldName, 'class="inputbox" style="width:90%;" multiple="multiple" size="10"', 'value', 'text', $value );
- return $output;
- }//end function fectchElement
- }//end class
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement