Esempio n. 1
0
 /**
  * Display the button
  *
  * @return array A two element array of ( imageName, textToInsert )
  */
 function onDisplay($name)
 {
     jimport('joomla.filesystem.file');
     // return if system plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.php')) {
         return;
     }
     // return if NoNumber! Elements plugin is not installed
     if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.php')) {
         return;
     }
     // load the admin language file
     $lang =& JFactory::getLanguage();
     if ($lang->getTag() != 'en-GB') {
         // Loads English language file as fallback (for undefined stuff in other language file)
         $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
     }
     $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
     // Load system plugin parameters
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
     $parameters =& NNParameters::getParameters();
     $system_params = JPluginHelper::getPlugin('system', $this->_name);
     $params = $parameters->getParams($system_params->params, JPATH_PLUGINS . DS . 'system' . DS . $this->_name . DS . $this->_name . '.xml');
     // Include the Helper
     require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php';
     $class = get_class($this) . 'Helper';
     $this->helper = new $class($params);
     return $this->helper->render($name);
 }
 function getPluginParamValues($name, $type = 'system')
 {
     jimport('joomla.plugin.plugin');
     $plugin = JPluginHelper::getPlugin($type, $name);
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
     $parameters =& NNParameters::getParameters();
     return $parameters->getParams($plugin->params, JPATH_PLUGINS . DS . $type . DS . $name . DS . $name . '.xml');
 }
Esempio n. 3
0
 /**
  * Function that gets the config settings
  *
  * @return	Object
  */
 protected function getConfig()
 {
     if (!isset($this->config)) {
         require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
         $parameters =& NNParameters::getParameters();
         $config = JComponentHelper::getParams('com_advancedmodules');
         $this->config = $parameters->getParams($config->toObject(), JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
     }
     return $this->config;
 }
Esempio n. 4
0
 function onAfterRoute()
 {
     $this->_pass = 0;
     // return if disabled via url
     // return if current page is raw format
     // return if current page is a joomfishplus page
     if (JRequest::getCmd('disable_modalizer') || JRequest::getCmd('format') == 'raw' || JRequest::getCmd('option') == 'com_joomfishplus') {
         return;
     }
     // load the admin language file
     $lang =& JFactory::getLanguage();
     if ($lang->getTag() != 'en-GB') {
         // Loads English language file as fallback (for undefined stuff in other language file)
         $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, 'en-GB');
     }
     $lang->load('plg_' . $this->_type . '_' . $this->_name, JPATH_ADMINISTRATOR, null, 1);
     $mainframe =& JFactory::getApplication();
     // return if NoNumber! Elements plugin is not installed
     jimport('joomla.filesystem.file');
     if (!JFile::exists(JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'nonumberelements.php')) {
         if ($mainframe->isAdmin() && JRequest::getCmd('option') !== 'com_login') {
             $msg = JText::_('MDL_NONUMBER_ELEMENTS_PLUGIN_NOT_INSTALLED');
             $mq = $mainframe->getMessageQueue();
             foreach ($mq as $m) {
                 if ($m['message'] == $msg) {
                     $msg = '';
                     break;
                 }
             }
             if ($msg) {
                 $mainframe->enqueueMessage($msg, 'error');
             }
         }
         return;
     }
     // return if current page is an administrator page (and not acymailing)
     if ($mainframe->isAdmin() && JRequest::getCmd('option') != 'com_acymailing') {
         return;
     }
     $this->_pass = 1;
     // Load plugin parameters
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
     $parameters =& NNParameters::getParameters();
     $params = $parameters->getParams($this->params->_raw, JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . '.xml');
     // Include the Helper
     require_once JPATH_PLUGINS . DS . $this->_type . DS . $this->_name . DS . 'helper.php';
     $class = get_class($this) . 'Helper';
     $this->helper = new $class($params);
 }
	function outputHTML( &$params, &$rows, &$client, &$page, &$lists )
	{
		$parameters =& NNParameters::getParameters();
		$system_params = $parameters->getPluginParamValues( 'modulesanywhere' );

		$tag = explode( ',', $system_params->module_tag );
		$tag = trim( $tag['0'] );
		$postag = explode( ',', $system_params->modulepos_tag );
		$postag = trim( $postag['0'] );

		JHTML::_( 'behavior.tooltip' );

		// Add scripts and styles
		$document =& JFactory::getDocument();
		$script = "
			function modulesanywhere_jInsertEditorText( id, modulepos ) {
				f = document.getElementById( 'adminForm' );
				if ( modulepos ) {
					str = '{".$postag." '+id+'}';
				} else {
					var style = f.style.options[f.style.selectedIndex].value.trim();
					var showtitle = f.showtitle.options[f.showtitle.selectedIndex].value.trim();

					str = '{".$tag." '+id;
					if ( style && style != '".$system_params->style."' ) {
						str += '|'+style;
					}
					if ( showtitle === '0' || showtitle === '1' ) {
						str += '|showtitle='+showtitle;
					}
					str += '}';
				}

				if ( f.div_enable.checked ) {
					var float = f.div_float.options[f.div_float.selectedIndex].value.trim();
					var params = new Array();
					if( f.div_width.value.trim() ) { params[params.length] = 'width:'+f.div_width.value.trim(); }
					if( f.div_height.value.trim() ) { params[params.length] = 'height:'+f.div_height.value.trim(); }
					if( float ) { params[params.length] = 'float:'+float; }
					if( f.div_class.value.trim() ) { params[params.length] = 'class:'+f.div_class.value.trim(); }
					str = ( '{div '+params.join('|') ).trim()+'}'+str.trim()+'{/div}';
				}

				window.parent.jInsertEditorText( str, '".JRequest::getVar( 'name' )."' );
				window.parent.SqueezeBox.close();
			}

			function toggleByCheckbox( id ) {
				el = document.getElementById( id );
				div = document.getElementById( id+'_div' );
				if ( el.checked ) {
					div.style.display = 'block';
				} else {
					div.style.display = 'none';
				}
			}
			window.addEvent('domready', function(){ toggleByCheckbox('div_enable'); });
		";
		$document->addScriptDeclaration( $script );
		$document->addStyleSheet( JURI::root( true ).'/plugins/system/nnframework/css/popup.css' );
		?>
	<div style="margin: 0;">
	<form action="" method="post" name="adminForm" id="adminForm">
	<fieldset>
		<div style="float: left">
			<h1><?php echo JText::_( 'MODULES_ANYWHERE' ); ?></h1>
		</div>
		<div style="float: right">
			<div class="button2-left">
				<div class="blank hasicon cancel">
					<a rel="" onclick="window.parent.SqueezeBox.close();" href="javascript://"
						title="<?php echo JText::_( 'JCANCEL' ) ?>"><?php echo JText::_( 'Cancel' ) ?></a>
				</div>
			</div>
		</div>
	</fieldset>

	<p><?php echo html_entity_decode( JText::_( 'MA_CLICK_ON_ONE_OF_THE_MODULES_LINKS' ), ENT_COMPAT, 'UTF-8' ); ?></p>

	<table class="adminform" cellspacing="2" style="width:auto;float:left;margin-right:10px;">
		<tr>
			<th>
				<?php echo JText::_( 'MA_MODULE_STYLE' ); ?>:
			</th>
			<td>
				<select name="style" class="inputbox">
					<?php
					$style = JRequest::getCmd( 'style' );
					if ( !$style ) {
						$style = $system_params->style;
					}
					?>
					<option <?php echo ( ( $style == 'none' ) ? 'selected="selected" value=""' : 'value="none"' ); ?>><?php echo JText::_( 'MA_NO_WRAPPING' ); ?></option>
					<option <?php echo ( ( $style == 'table' ) ? 'selected="selected" value=""' : 'value="table"' ); ?>><?php echo JText::_( 'MA_TABLE' ); ?></option>
					<option <?php echo ( ( $style == 'horz' ) ? 'selected="selected" value=""' : 'value="horz"' ); ?>><?php echo JText::_( 'MA_HORZ' ); ?></option>
					<option <?php echo ( ( $style == 'xhtml' ) ? 'selected="selected" value=""' : 'value="xhtml"' ); ?>><?php echo JText::_( 'MA_XHTML' ); ?></option>
					<option <?php echo ( ( $style == 'rounded' ) ? 'selected="selected" value=""' : 'value="rounded"' ); ?>><?php echo JText::_( 'MA_ROUNDED' ); ?></option>
				</select>
			</td>
		</tr>
		<tr>
			<th>
						<span class="hasTip"
							title="<?php echo JText::_( 'COM_MODULES_FIELD_SHOWTITLE_LABEL' ).'::'.JText::_( 'COM_MODULES_FIELD_SHOWTITLE_DESC' ); ?>">
							<?php echo JText::_( 'COM_MODULES_FIELD_SHOWTITLE_LABEL' ); ?>:
						</span>
			</th>
			<td>
				<select name="showtitle" class="inputbox">
					<option value=""><?php echo JText::_( 'JDEFAULT' ); ?></option>
					<option value="0"><?php echo JText::_( 'JNO' ); ?></option>
					<option value="1"><?php echo JText::_( 'JYES' ); ?></option>
				</select>
			</td>
		</tr>
	</table>

	<table class="adminform" cellspacing="2" style="width:auto;float:left;">
		<tr style="height:30px;">
			<th>
				<label class="hasTip"
					title="<?php echo JText::_( 'MA_EMBED_IN_A_DIV' ).'::'.JText::_( 'MA_EMBED_IN_A_DIV_DESC' ); ?>">
					<input type="checkbox" onclick="toggleByCheckbox('div_enable');"
						onchange="toggleByCheckbox('div_enable');" name="div_enable"
						id="div_enable" <?php echo ( $params->div_enable ) ? 'checked="checked"' : ''; ?> />
					<?php echo JText::_( 'MA_EMBED_IN_A_DIV' ); ?>&nbsp;
				</label>

				<div id="div_enable_div" style="display:block;">
					<table>
						<tr>
							<td>
								<label class="hasTip"
									title="<?php echo JText::_( 'NN_WIDTH' ).'::'.JText::_( 'MA_WIDTH_DESC' ); ?>">
									<?php echo JText::_( 'NN_WIDTH' ); ?>:
									<input type="text" class="text_area" name="div_width" id="div_width"
										value="<?php echo $params->div_width; ?>" size="4" style="text-align: right;" />
								</label>
							</td>
							<td>
								<label class="hasTip"
									title="<?php echo JText::_( 'NN_HEIGHT' ).'::'.JText::_( 'MA_HEIGHT_DESC' ); ?>">
									<?php echo JText::_( 'NN_HEIGHT' ); ?>:
									<input type="text" class="text_area" name="div_height" id="div_height"
										value="<?php echo $params->div_height; ?>" size="4"
										style="text-align: right;" />
								</label>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<label class="hasTip"
									title="<?php echo JText::_( 'MA_ALIGNMENT' ).'::'.JText::_( 'MA_ALIGNMENT_DESC' ); ?>">
									<?php echo JText::_( 'MA_ALIGNMENT' ); ?>:
									<select name="div_float" id="div_float" class="inputbox">
										<option
											value=""<?php echo ( !$params->div_float ) ? 'selected="selected"' : ''; ?>>
											<?php echo JText::_( 'JNONE' ); ?></option>
										<option
											value="left"<?php echo ( $params->div_float == 'left' ) ? 'selected="selected"' : ''; ?>>
											<?php echo JText::_( 'JGLOBAL_LEFT' ); ?></option>
										<option
											value="right"<?php echo ( $params->div_float == 'right' ) ? 'selected="selected"' : ''; ?>>
											<?php echo JText::_( 'JGLOBAL_RIGHT' ); ?></option>
									</select>
								</label>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<label class="hasTip"
									title="<?php echo JText::_( 'MA_DIV_CLASSNAME' ).'::'.JText::_( 'MA_DIV_CLASSNAME_DESC' ); ?>">
									<?php echo JText::_( 'MA_DIV_CLASSNAME' ); ?>:
									<input type="text" class="text_area" name="div_class" id="div_class"
										value="<?php echo $params->div_class; ?>" />
								</label>
							</td>
						</tr>
					</table>
				</div>
			</th>
		</tr>
	</table>

	<div style="clear:both;"></div>

	<table class="adminform" cellspacing="1">
		<tbody>
			<tr>
				<td>
					<?php echo JText::_( 'Filter' ); ?>:
					<input type="text" name="search" id="search" value="<?php echo $lists['search'];?>"
						class="text_area" onchange="this.form.submit();" />
					<button onclick="this.form.submit();"><?php echo JText::_( 'Go' ); ?></button>
					<button onclick="
								document.getElementById( 'search' ).value='';
								document.getElementById( 'filter_position' ).value='0';
								document.getElementById( 'filter_type' ).value='0';
								document.getElementById( 'filter_state' ).value='';
								this.form.submit();"><?php echo JText::_( 'Reset' ); ?></button>
				</td>
				<td style="text-align:right;">
					<?php
					echo $lists['position'];
					echo $lists['type'];
					echo $lists['state'];
					?>
				</td>
			</tr>
		</tbody>
	</table>

	<table class="adminlist" cellspacing="1">
		<thead>
			<tr>
				<th nowrap="nowrap" width="1%">
					<?php echo JHTML::_( 'grid.sort', 'ID', 'm.id', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<th class="title">
					<?php echo JHTML::_( 'grid.sort', 'Module Name', 'm.title', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<th nowrap="nowrap" width="7%">
					<?php echo JHTML::_( 'grid.sort', 'Position', 'm.position', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<th nowrap="nowrap" width="7%">
					<?php echo JHTML::_( 'grid.sort', 'Published', 'm.published', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<th nowrap="nowrap" width="1%">
					<?php echo JHTML::_( 'grid.sort', 'Order', 'm.ordering', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<?php if ( $client->id == 0 ) { ?>
				<th nowrap="nowrap" width="7%">
					<?php echo JHTML::_( 'grid.sort', 'Access', 'groupname', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<?php } ?>
				<th nowrap="nowrap" width="5%">
					<?php echo JHTML::_( 'grid.sort', 'Pages', 'pages', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
				<th nowrap="nowrap" width="10%" class="title">
					<?php echo JHTML::_( 'grid.sort', 'Type', 'm.module', @$lists['order_Dir'], @$lists['order'] ); ?>
				</th>
			</tr>
		</thead>
		<tfoot>
			<tr>
				<td colspan="<?php echo ( $client->id == 0 ) ? '8' : '7'; ?>">
					<?php
					$pagination = str_replace( 'index.php?', 'plugins/editors-xtd/modulesanywhere/elements/modulesanywhere.page.php?name='.JRequest::getCmd( 'name', 'text' ).'&', $page->getListFooter() );
					$pagination = str_replace( 'index.php', 'plugins/editors-xtd/modulesanywhere/elements/modulesanywhere.page.php?name='.JRequest::getCmd( 'name', 'text' ), $pagination );
					echo $pagination;
					?>
				</td>
			</tr>
		</tfoot>
		<tbody>
			<?php
			$k = 0;
			for ( $i = 0, $n = count( $rows ); $i < $n; $i++ ) {
				$row =& $rows[$i];

				if ( $row->published ) {
					$img = 'tick_l.png';
					$alt = JText::_( 'Published' );
				} else {
					$img = 'publish_x_l.png';
					$alt = JText::_( 'Unpublished' );
				}
				?>
				<tr class="<?php echo "row$k"; ?>">
					<td align="right">
						<?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_ID_IN_TAG' ).'::{module '.$row->id.'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.$row->id.'\' )">'.$row->id.'</a></label>';?>
					</td>
					<td>
						<?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_TITLE_IN_TAG' ).'::{module '.htmlspecialchars( $row->title ).'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.addslashes( htmlspecialchars( $row->title ) ).'\' )">'.htmlspecialchars( $row->title ).'</a></label>'; ?>
					</td>
					<td align="center">
						<?php echo '<label class="hasTip" title="'.JText::_( 'MA_USE_MODULE_POSITION_TAG' ).'::{modulepos '.$row->position.'}"><a href="javascript://" onclick="modulesanywhere_jInsertEditorText( \''.$row->position.'\', 1 )">'.$row->position.'</a></label>'; ?>
					</td>
					<td style="text-align:center;">
						<img src="<?php echo JURI::root( true ).'/plugins/system/nnframework/images/'.$img; ?>"
							width="16" height="16" border="0" alt="<?php echo $alt; ?>'" />
					</td>
					<td align="center">
						<?php echo $row->ordering; ?>
					</td>
					<?php if ( $client->id == 0 ) { ?>
					<td align="center"><?php echo JText::_( $row->groupname ); ?></td>
					<?php } ?>
					<td align="center">
						<?php
						if ( is_null( $row->pages ) ) {
							echo JText::_( 'None' );
						} else if ( $row->pages > 0 ) {
							echo JText::_( 'Varies' );
						} else {
							echo JText::_( 'All' );
						}
						?>
					</td>
					<td>
						<?php echo $row->module ? $row->module : JText::_( 'User' ); ?>
					</td>
				</tr>
				<?php
				$k = 1 - $k;
			}
			?>
		</tbody>
	</table>
	<input type="hidden" name="name" value="<?php echo JRequest::getCmd( 'name', 'text' ); ?>" />
	<input type="hidden" name="client" value="<?php echo $client->id;?>" />
	<input type="hidden" name="filter_order" value="<?php echo $lists['order']; ?>" />
	<input type="hidden" name="filter_order_Dir" value="<?php echo $lists['order_Dir']; ?>" />
	</form>
	</div>
	<?php
	}
Esempio n. 6
0
 function getMenuItemParams($id = 0)
 {
     $query = 'SELECT params' . ' FROM #__menu' . ' WHERE id = ' . (int) $id . ' LIMIT 1';
     $this->_db->setQuery($query);
     $params = $this->_db->loadResult();
     $parameters =& NNParameters::getParameters();
     return $parameters->getParams($params);
 }
Esempio n. 7
0
 function render(&$params)
 {
     $option = JRequest::getCmd('option');
     $this->vars = array();
     jimport('joomla.filesystem.folder');
     jimport('joomla.filesystem.file');
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
     $parameters =& NNParameters::getParameters();
     $folder = dirname(__FILE__) . DS . 'components' . DS . $option;
     $comp_file = '';
     foreach (JFolder::files($folder, '.xml') as $filename) {
         $file = $folder . DS . $filename;
         $xml =& JFactory::getXMLParser('Simple');
         $xml->loadFile($file);
         if (isset($xml->document) && isset($xml->document->_children)) {
             $template = $parameters->getObjectFromXML($xml->document->_children);
             if (isset($template->params) && isset($template->params->required)) {
                 if (!is_object($template->params->required) || modAddToMenu::checkRequiredFields($template->params->required)) {
                     $template = $template->params;
                     $comp_file = JFile::stripExt($filename);
                     break;
                 }
             }
         }
     }
     if (!$comp_file) {
         return;
     }
     JHTML::_('behavior.modal');
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'functions.php';
     $this->functions =& NNFunctions::getFunctions();
     $mt_version = $this->functions->getJSVersion();
     $document =& JFactory::getDocument();
     $document->addScript(JURI::root(true) . '/administrator/modules/mod_addtomenu/addtomenu/js/script' . $mt_version . '.js');
     $document->addStyleSheet(JURI::root(true) . '/administrator/modules/mod_addtomenu/addtomenu/css/style.css');
     // set height for popup
     $popup_height = 320;
     if (isset($template->adjust_height)) {
         $popup_height += $template->adjust_height;
     }
     if (isset($template->extras) && is_object($template->extras) && isset($template->extras->extra)) {
         if (!is_array($template->extras->extra)) {
             $template->extras->extra = array($template->extras->extra);
         }
         $haselements = 0;
         // + heights of elements
         foreach ($template->extras->extra as $element) {
             if (isset($element->type)) {
                 $haselements = 1;
                 switch ($element->type) {
                     case 'radio':
                         // add height for every line
                         $popup_height += 8 + 16 * count($element['value']);
                         break;
                     case 'textarea':
                         $popup_height += 111;
                         break;
                     case 'hidden':
                     case 'toggler':
                         // no height
                         break;
                     default:
                         $popup_height += 24;
                         break;
                 }
             }
         }
         if ($haselements) {
             // + height of title
             $popup_height += 23;
         }
     }
     $link = 'index.php?nn_qp=1';
     $link .= '&folder=administrator.modules.mod_addtomenu.addtomenu';
     $link .= '&file=addtomenu.inc.php';
     $link .= '&comp=' . $comp_file;
     $uri =& JFactory::getURI();
     $url_query = $uri->getQuery(1);
     foreach ($url_query as $key => $val) {
         $this->vars[$key] = $val;
     }
     if (!isset($this->vars['option'])) {
         $this->vars['option'] = $option;
     }
     foreach ($this->vars as $key => $val) {
         if (is_array($val)) {
             $val = $val['0'];
         }
         $link .= '&vars[' . $key . ']=' . $val;
     }
     $text = JText::_($params->get('icon_text', 'ADD_TO_MENU'));
     $title = $text;
     $class = '';
     if ($params->get('display_link', 'both') == 'text') {
         $class = 'no_icon';
     } else {
         if ($params->get('display_link', 'both') == 'icon') {
             $text = '';
             $class = 'no_text';
         }
     }
     if ($params->get('display_tooltip', 1)) {
         JHTML::_('behavior.tooltip');
         $class .= ' hasTip';
         $title = JText::_('ADD_TO_MENU') . '::' . JText::_('Add') . ': ' . JText::_($template->name);
     }
     echo '<a href="' . $link . '" onfocus="this.blur();" id="addtomenu" class="modal" rel="{handler: \'iframe\', size: {x: 400, y: ' . $popup_height . '}}"><span class="' . $class . '"  title="' . $title . '">' . $text . '</span></a>';
 }
Esempio n. 8
0
 /**
  * Compiles information to add or edit a module
  * @param string The current GET/POST option
  * @param integer The unique id of the record to edit
  */
 function edit()
 {
     // Initialize some variables
     $db =& JFactory::getDBO();
     $user =& JFactory::getUser();
     $client =& JApplicationHelper::getClientInfo(JRequest::getVar('client', '0', '', 'int'));
     $module = JRequest::getVar('module', '', '', 'cmd');
     $id = JRequest::getVar('id', 0, 'method', 'int');
     $cid = JRequest::getVar('cid', array($id), 'method', 'array');
     JArrayHelper::toInteger($cid, array(0));
     $model =& $this->getModel('module');
     $model->setState('id', $cid['0']);
     $model->setState('clientId', $client->id);
     $lists = array();
     $row =& JTable::getInstance('module');
     // load the row from the db table
     $row->load((int) $cid['0']);
     // fail if checked out not by 'me'
     if ($row->isCheckedOut($user->get('id'))) {
         $this->setRedirect('index.php?option=com_advancedmodules&client=' . $client->id);
         return JError::raiseWarning(500, JText::sprintf('DESCBEINGEDITTED', JText::_('The module'), $row->title));
     }
     $row->content = htmlspecialchars($row->content, ENT_COMPAT, 'UTF-8');
     if ($cid['0']) {
         $row->checkout($user->get('id'));
     }
     // if a new record we must still prime the JTableModel object with a default
     // position and the order; also add an extra item to the order list to
     // place the 'new' record in last position if desired
     if ($cid['0'] == 0) {
         $row->position = 'left';
         $row->showtitle = true;
         $row->published = 1;
         //$row->ordering = $l;
         $row->module = $module;
     }
     if ($client->id == 1) {
         $where = 'client_id = 1';
         $lists['client_id'] = 1;
         $path = 'mod1_xml';
     } else {
         $where = 'client_id = 0';
         $lists['client_id'] = 0;
         $path = 'mod0_xml';
     }
     $query = 'SELECT position, ordering, showtitle, title' . ' FROM #__modules' . ' WHERE ' . $where . ' ORDER BY ordering';
     $db->setQuery($query);
     $orders = $db->loadObjectList();
     if ($db->getErrorNum()) {
         echo $db->stderr();
         return false;
     }
     $orders2 = array();
     $l = 0;
     $r = 0;
     for ($i = 0, $n = count($orders); $i < $n; $i++) {
         $ord = 0;
         if (array_key_exists($orders[$i]->position, $orders2)) {
             $ord = count(array_keys($orders2[$orders[$i]->position])) + 1;
         }
         $orders2[$orders[$i]->position][] = JHTML::_('select.option', $ord, $ord . '::' . htmlspecialchars($orders[$i]->title));
     }
     $color = 'FFFFFF';
     if ($client->id != 1) {
         $parameters =& NNParameters::getParameters();
         $config = JComponentHelper::getParams('com_advancedmodules');
         $config = $parameters->getParams($config->_raw, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
         $advanced_params = new stdClass();
         $xmlfile = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'assignments.xml';
         if (!$cid['0']) {
             $lists['assignments'] = new JParameter('', $xmlfile);
             // hide if empty
             $lists['hideempty'] = JHTML::_('select.booleanlist', 'advancedparams[hideempty]', 'class="inputbox"', 0, 'yes', 'no', 'advancedparamshideempty');
             // tooltip
             $lists['tooltip'] = '<textarea class="text_area" rows="3" cols="40" name="advancedparams[tooltip]" id="advancedparamstooltip"></textarea>';
         } else {
             // advanced params
             $query = 'SELECT params' . ' FROM #__advancedmodules' . ' WHERE moduleid = ' . (int) $row->id;
             $db->setQuery($query);
             $advanced_params = $db->loadResult();
             if (!$advanced_params || strpos($advanced_params, 'assignto_') === false) {
                 $advanced_params = $this->updateParams($row->id, $advanced_params);
             }
             $lists['assignments'] = new JParameter($advanced_params, $xmlfile);
             $advanced_params = $parameters->getParams($advanced_params);
             // hide if empty
             $lists['hideempty'] = JHTML::_('select.booleanlist', 'advancedparams[hideempty]', 'class="inputbox"', isset($advanced_params->hideempty) ? $advanced_params->hideempty : 0, 'yes', 'no', 'advancedparamshideempty');
             // tooltip
             $lists['tooltip'] = '<textarea class="text_area" rows="3" cols="40" name="advancedparams[tooltip]" id="advancedparamstooltip">' . (isset($advanced_params->tooltip) ? $advanced_params->tooltip : '') . '</textarea>';
             if (isset($advanced_params->color)) {
                 $color = strtoupper(preg_replace('#[^a-z0-9]#si', '', $advanced_params->color));
             }
         }
         require_once JPATH_SITE . DS . 'plugins' . DS . 'system' . DS . 'nonumberelements' . DS . 'elements' . DS . 'colorpicker.php';
         $cp = new JElementColorPicker();
         $node = new JSimpleXMLElement('');
         $lists['color'] = $cp->fetchElement('color', $color, $node, 'advancedparams');
         $lists['extra'] = '';
         if ($config->show_extra) {
             if ($config->extra1) {
                 $xml = new JSimpleXMLElement('extra', array());
                 $extraparams = array();
                 for ($i = 1; $i <= 5; $i++) {
                     $var = 'extra' . $i;
                     if ($config->{$var}) {
                         $a = array();
                         $a['name'] = $var;
                         $a['type'] = 'text';
                         $label = explode('\\|', $config->{$var}, 2);
                         $a['label'] = $label['0'];
                         if (isset($label['1'])) {
                             $a['description'] = $label['1'];
                         }
                         $xml->addChild('extra1', $a);
                     }
                     if (isset($advanced_params->{$var})) {
                         $extraparams[] = $var . '=' . $advanced_params->{$var};
                     }
                 }
                 $p = new JParameter(implode("\n", $extraparams));
                 $p->setXML($xml);
                 if ($p->getNumParams()) {
                     $lists['extra'] = $p->render('advancedparams');
                 }
             }
         }
     }
     if ($row->access == 99 || $row->client_id == 1 || $lists['client_id']) {
         $lists['access'] = 'Administrator';
         $lists['showtitle'] = 'N/A <input type="hidden" name="showtitle" value="1" />';
         $lists['selections'] = 'N/A';
     } else {
         if ($client->id == '1') {
             $lists['access'] = 'N/A';
         } else {
             $lists['access'] = JHTML::_('list.accesslevel', $row);
         }
         $lists['showtitle'] = JHTML::_('select.booleanlist', 'showtitle', 'class="inputbox"', $row->showtitle);
     }
     // build the html select list for published
     $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published);
     $row->description = '';
     $lang =& JFactory::getLanguage();
     if ($client->id != '1') {
         $lang->load(trim($row->module), JPATH_SITE);
     } else {
         $lang->load(trim($row->module));
     }
     // xml file for module
     if ($row->module == 'custom') {
         $xmlfile = JApplicationHelper::getPath($path, 'mod_custom');
     } else {
         $xmlfile = JApplicationHelper::getPath($path, $row->module);
     }
     $data = JApplicationHelper::parseXMLInstallFile($xmlfile);
     if ($data) {
         foreach ($data as $key => $value) {
             $row->{$key} = $value;
         }
     }
     // get params definitions
     $params = new JParameter($row->params, $xmlfile, 'module');
     require_once JApplicationHelper::getPath('admin_html');
     HTML_modules::edit($model, $row, $orders2, $lists, $params, $client);
 }
    function outputHTML(&$params, &$rows, &$client, &$page, &$lists, $k2 = 0)
    {
        $mainframe =& JFactory::getApplication();
        $parameters =& NNParameters::getParameters();
        $system_params = $parameters->getPluginParamValues('articlesanywhere');
        JHTML::_('behavior.tooltip');
        $plugin_tag = explode(',', $system_params->article_tag);
        $plugin_tag = trim($plugin_tag['0']);
        $content_type = JRequest::getCmd('content_type', $params->content_type);
        if (!empty($_POST)) {
            foreach ($params as $key => $val) {
                if (array_key_exists($key, $_POST)) {
                    $params->{$key} = $_POST[$key];
                } else {
                    $params->{$key} = 0;
                }
            }
        }
        require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php';
        $version = NoNumberVersions::getXMLVersion(null, null, null, 1);
        // Add scripts and styles
        $document =& JFactory::getDocument();
        $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/popup.css' . $version);
        $script = "\n\t\t\tfunction articlesanywhere_jInsertEditorText( id ) {\n\t\t\t\tvar f = document.getElementById( 'adminForm' );\n\t\t\t\tvar str = '';\n\n\t\t\t\tif ( f.data_title_enable.checked ) {\n\t\t\t\t\tstr += ' {title}';\n\t\t\t\t}\n\n\t\t\t\tif ( f.data_text_enable.checked ) {\n\t\t\t\t\tvar tag = f.data_text_type.options[f.data_text_type.selectedIndex].value.trim();\n\t\t\t\t\tvar text_length = parseInt( f.data_text_length.value.trim() );\n\t\t\t\t\tif ( text_length && text_length != 0 ) {\n\t\t\t\t\t\ttag += ':'+text_length;\n\t\t\t\t\t}\n\t\t\t\t\tif ( f.data_text_strip.checked ) {\n\t\t\t\t\t\ttag += ':strip';\n\t\t\t\t\t}\n\t\t\t\t\tstr += ' {'+tag+'}';\n\t\t\t\t}\n\n\t\t\t\tif ( f.data_readmore_enable.checked ) {\n\t\t\t\t\tvar tag = 'readmore';\n\t\t\t\t\tvar readmore_text = f.data_readmore_text.value.trim();\n\t\t\t\t\tvar readmore_class = f.data_readmore_class.value.trim();\n\t\t\t\t\tif ( readmore_text ) {\n\t\t\t\t\t\ttag += ':'+readmore_text;\n\t\t\t\t\t}\n\t\t\t\t\tif ( readmore_class && readmore_class != 'readon' ) {\n\t\t\t\t\t\tif ( !readmore_text ) {\n\t\t\t\t\t\t\ttag += ':';\n\t\t\t\t\t\t}\n\t\t\t\t\t\ttag += '|'+readmore_class;\n\t\t\t\t\t}\n\t\t\t\t\tstr += ' {'+tag+'}';\n\t\t\t\t}\n\n\t\t\t\tif ( f.data_id_enable.checked ) {\n\t\t\t\t\tstr += ' {id}';\n\t\t\t\t}\n\n\t\t\t\tif ( f.div_enable.checked ) {\n\t\t\t\t\tvar float = f.div_float.options[f.div_float.selectedIndex].value.trim();\n\t\t\t\t\tvar params = new Array();\n\t\t\t\t\tif( f.div_width.value.trim() ) { params[params.length] = 'width:'+f.div_width.value.trim(); }\n\t\t\t\t\tif( f.div_height.value.trim() ) { params[params.length] = 'height:'+f.div_height.value.trim(); }\n\t\t\t\t\tif( float ) { params[params.length] = 'float:'+float; }\n\t\t\t\t\tif( f.div_class.value.trim() ) { params[params.length] = 'class:'+f.div_class.value.trim(); }\n\t\t\t\t\tstr = ( '{div '+params.join('|') ).trim()+'}'+str.trim()+'{/div}';\n\t\t\t\t}\n\n\t\t\t\tstr = '{" . $plugin_tag . " " . ($content_type == 'k2' ? 'k2:' : '') . "'+id+'}'+str.trim()+'{/" . $plugin_tag . "}';\n\n\t\t\t\twindow.parent.jInsertEditorText( str, '" . JRequest::getVar('name') . "' );\n\t\t\t\twindow.parent.SqueezeBox.close();\n\t\t\t}\n\n\t\t\tfunction toggleByCheckbox( id ) {\n\t\t\t\tel = document.getElementById( id );\n\t\t\t\tdiv = document.getElementById( id+'_div' );\n\t\t\t\tif ( el.checked ) {\n\t\t\t\t\tdiv.style.display = 'block';\n\t\t\t\t} else {\n\t\t\t\t\tdiv.style.display = 'none';\n\t\t\t\t}\n\t\t\t}\n\t\t\twindow.addEvent('domready', function(){ toggleByCheckbox('div_enable'); });\n\t\t";
        $document->addScriptDeclaration($script);
        ?>
	<div style="margin: 0;">
		<form action="" method="post" name="adminForm" id="adminForm">
			<fieldset>
				<div style="float: left">
					<h1><?php 
        echo JText::_('ARTICLES_ANYWHERE');
        ?>
</h1>
				</div>
				<div style="float: right">
					<div class="button2-left"><div class="blank hasicon cancel">
						<a rel="" onclick="window.parent.SqueezeBox.close();" href="javascript://" title="<?php 
        echo JText::_('Cancel');
        ?>
"><?php 
        echo JText::_('Cancel');
        ?>
</a>
					</div></div>
				</div>
			</fieldset>
			<p><?php 
        echo JText::_('AA_CLICK_ON_ONE_OF_THE_ARTICLE_LINKS');
        if ($mainframe->isAdmin()) {
            $link = JURI::base(true) . '/index.php?option=com_plugins&client=site&filter_type=system&search=articles%20anywhere';
            echo '<br />' . html_entity_decode(JText::sprintf('AA_MORE_SYNTAX_HELP', $link), ENT_COMPAT, 'UTF-8');
        }
        ?>
</p>
			<div style="clear:both;"></div>
			<table class="adminform" cellspacing="2" style="width:auto;float:left;margin-right:10px;">
				<tr>
					<th colspan="3">
						<label class="hasTip" title="<?php 
        echo JText::_('AA_TITLE_TAG') . '::' . JText::_('AA_TITLE_TAG_DESC');
        ?>
">
							<input type="checkbox" name="data_title_enable" id="data_title_enable" <?php 
        if ($params->data_title_enable) {
            echo 'checked="checked"';
        }
        ?>
 />
							<?php 
        echo JText::_('Title');
        ?>
						</label>
					</th>
				</tr>
				<tr>
					<th>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_TEXT_TAG') . '::' . JText::_('AA_TEXT_TAG_DESC');
        ?>
">
							<input type="checkbox" name="data_text_enable" id="data_text_enable" <?php 
        if ($params->data_text_enable) {
            echo 'checked="checked"';
        }
        ?>
 />
						</label>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_TEXT_TYPE') . '::' . JText::_('AA_TEXT_TYPE_DESC');
        ?>
">
							<select name="data_text_type" class="inputbox">
								<option value="text"<?php 
        if ($params->data_text_type == 'text') {
            echo 'selected="selected"';
        }
        ?>
>
									<?php 
        echo JText::_('AA_ALL_TEXT');
        ?>
</option>
								<option value="introtext"<?php 
        if ($params->data_text_type == 'introtext') {
            echo 'selected="selected"';
        }
        ?>
>
									<?php 
        echo JText::_('AA_INTRO_TEXT');
        ?>
</option>
								<option value="fulltext"<?php 
        if ($params->data_text_type == 'fulltext') {
            echo 'selected="selected"';
        }
        ?>
>
									<?php 
        echo JText::_('AA_FULL_TEXT');
        ?>
</option>
							</select>
						</label>
					</th>
					<td>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_MAXIMUM_TEXT_LENGTH') . '::' . JText::_('AA_MAXIMUM_TEXT_LENGTH_DESC');
        ?>
">
							<?php 
        echo JText::_('AA_MAXIMUM_TEXT_LENGTH');
        ?>
:
							<input type="text" class="text_area" name="data_text_length" id="data_text_length" value="<?php 
        echo $params->data_text_length;
        ?>
" size="4" style="text-align: right;" />
						</label>
					</td>
					<td>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_STRIP_HTML_TAGS') . '::' . JText::_('AA_STRIP_HTML_TAGS_DESC');
        ?>
">
							<input type="checkbox" name="data_text_strip" id="data_text_strip" <?php 
        if ($params->data_text_strip) {
            echo 'checked="checked"';
        }
        ?>
 />
							<?php 
        echo JText::_('AA_STRIP_HTML_TAGS');
        ?>
						</label>
					</td>
				</tr>
				<tr>
					<th>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_READMORE_TAG') . '::' . JText::_('AA_READMORE_TAG_DESC');
        ?>
">
							<input type="checkbox" name="data_readmore_enable" id="data_readmore_enable" <?php 
        if ($params->data_readmore_enable) {
            echo 'checked="checked"';
        }
        ?>
 />
							<?php 
        echo JText::_('AA_READMORE_LINK');
        ?>
						</label>
					</th>
					<td>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_READMORE_TEXT') . '::' . JText::_('AA_READMORE_TEXT_DESC');
        ?>
">
							<?php 
        echo JText::_('AA_READMORE_TEXT');
        ?>
:
							<input type="text" class="text_area" name="data_readmore_text" id="data_readmore_text" value="<?php 
        echo $params->data_readmore_text;
        ?>
" />
						</label>
					</td>
					<td>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_CLASSNAME') . '::' . JText::_('AA_CLASSNAME_DESC');
        ?>
">
							<?php 
        echo JText::_('AA_CLASSNAME');
        ?>
:
							<input type="text" class="text_area" name="data_readmore_class" id="data_readmore_class" value="<?php 
        echo $params->data_readmore_class;
        ?>
" />
						</label>
					</td>
				</tr>
				<tr>
					<th colspan="3">
						<label class="hasTip" title="<?php 
        echo JText::_('AA_ID_TAG') . '::' . JText::_('AA_ID_TAG_DESC');
        ?>
">
							<input type="checkbox" name="data_id_enable" id="data_id_enable" <?php 
        if ($params->data_id_enable) {
            echo 'checked="checked"';
        }
        ?>
 />
							<?php 
        echo JText::_('ID');
        ?>
						</label>
					</th>
				</tr>
			</table>

			<table class="adminform" cellspacing="2" style="width:auto;float:left;">
				<tr>
					<th>
						<label class="hasTip" title="<?php 
        echo JText::_('AA_EMBED_IN_A_DIV') . '::' . JText::_('AA_EMBED_IN_A_DIV_DESC');
        ?>
">
							<input type="checkbox" onclick="toggleByCheckbox('div_enable');" onchange="toggleByCheckbox('div_enable');" name="div_enable" id="div_enable" <?php 
        if ($params->div_enable) {
            echo 'checked="checked"';
        }
        ?>
 />
							<?php 
        echo JText::_('AA_EMBED_IN_A_DIV');
        ?>
&nbsp;
						</label>
						<div id="div_enable_div" style="display:block;">
							<table>
								<tr>
									<td>
										<label class="hasTip" title="<?php 
        echo JText::_('NN_WIDTH') . '::' . JText::_('AA_WIDTH_DESC');
        ?>
">
											<?php 
        echo JText::_('NN_WIDTH');
        ?>
:
											<input type="text" class="text_area" name="div_width" id="div_width" value="<?php 
        echo $params->div_width;
        ?>
" size="4" style="text-align: right;" />
										</label>
									</td>
									<td>
										<label class="hasTip" title="<?php 
        echo JText::_('NN_HEIGHT') . '::' . JText::_('AA_HEIGHT_DESC');
        ?>
">
											<?php 
        echo JText::_('NN_HEIGHT');
        ?>
:
											<input type="text" class="text_area" name="div_height" id="div_height" value="<?php 
        echo $params->div_height;
        ?>
" size="4" style="text-align: right;" />
										</label>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<label class="hasTip" title="<?php 
        echo JText::_('AA_ALIGNMENT') . '::' . JText::_('AA_ALIGNMENT_DESC');
        ?>
">
											<?php 
        echo JText::_('AA_ALIGNMENT');
        ?>
:
											<select name="div_float" id="div_float" class="inputbox">
												<option value=""<?php 
        if (!$params->div_float) {
            echo 'selected="selected"';
        }
        ?>
>
													<?php 
        echo JText::_('None');
        ?>
</option>
												<option value="left"<?php 
        if ($params->div_float == 'left') {
            echo 'selected="selected"';
        }
        ?>
>
													<?php 
        echo JText::_('Left');
        ?>
</option>
												<option value="right"<?php 
        if ($params->div_float == 'right') {
            echo 'selected="selected"';
        }
        ?>
>
													<?php 
        echo JText::_('Right');
        ?>
</option>
											</select>
										</label>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<label class="hasTip" title="<?php 
        echo JText::_('AA_DIV_CLASSNAME') . '::' . JText::_('AA_DIV_CLASSNAME_DESC');
        ?>
">
											<?php 
        echo JText::_('AA_DIV_CLASSNAME');
        ?>
:
											<input type="text" class="text_area" name="div_class" id="div_class" value="<?php 
        echo $params->div_class;
        ?>
" />
										</label>
									</td>
								</tr>
							</table>
						</div>
					</th>
				</tr>
			</table>

			<div style="clear:both;"></div>

		<?php 
        if ($k2) {
            ?>
			<table class="adminform" cellspacing="2" style="width:auto;">
				<tr>
					<th>
						<?php 
            echo JText::_('AA_CONTENT_TYPE');
            ?>
					</th>
					<td>
						<label class="hasTip" title="<?php 
            echo JText::_('AA_CONTENT_TYPE_CORE') . '::' . JText::_('AA_CONTENT_TYPE_CORE_DESC');
            ?>
">
							<input onchange="form.submit()" type="radio" name="content_type" id="content_type_core" value="core" <?php 
            if ($content_type == 'core') {
                echo 'checked="checked"';
            }
            ?>
 />
							<?php 
            echo JText::_('AA_CONTENT_TYPE_CORE');
            ?>
						</label>
					</td>
					<td>
						<label class="hasTip" title="<?php 
            echo JText::_('AA_CONTENT_TYPE_K2') . '::' . JText::_('AA_CONTENT_TYPE_K2_DESC');
            ?>
">
							<input onchange="form.submit()" type="radio" name="content_type" id="content_type_k2" value="k2" <?php 
            if ($content_type == 'k2') {
                echo 'checked="checked"';
            }
            ?>
 />
							<?php 
            echo JText::_('AA_CONTENT_TYPE_K2');
            ?>
						</label>
					</td>
				</tr>
			</table>
		<?php 
        }
        ?>

		<?php 
        if ($k2 && $content_type == 'k2') {
            $this->outputTableK2($rows, $client, $page, $lists);
        } else {
            $this->outputTableCore($rows, $client, $page, $lists);
        }
        ?>

			<input type="hidden" name="name" value="<?php 
        echo JRequest::getCmd('name', 'text');
        ?>
" />
			<input type="hidden" name="client" value="<?php 
        echo $client->id;
        ?>
" />
			<input type="hidden" name="filter_order" value="<?php 
        echo $lists['order'];
        ?>
" />
			<input type="hidden" name="filter_order_Dir" value="<?php 
        echo $lists['order_Dir'];
        ?>
" />
		</form>
	</div>
	<?php 
    }
Esempio n. 10
0
function plgSystemAdvancedModulesPrepareModuleList(&$modules)
{
    $mainframe =& JFactory::getApplication();
    $client = $mainframe->getClientId();
    if ($client == 0) {
        $db =& JFactory::getDBO();
        jimport('joomla.filesystem.file');
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
        $parameters =& NNParameters::getParameters();
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'assignments.php';
        $assignments = new NoNumberElementsAssignmentsHelper();
        $xmlfile_assignments = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'assignments.xml';
        $config = plgSystemAdvancedModulesConfig();
        // set params for all loaded modules first
        // and make it an associated array (array id = module id)
        $new_modules = array();
        foreach ($modules as $id => $module) {
            if (!isset($module->adv_params)) {
                $modarray = get_object_vars($module);
                if (!array_key_exists('adv_params', $modarray)) {
                    $modules[$id]->adv_params = 0;
                    continue;
                }
            }
            if (strpos($module->adv_params, 'assignto_menuitems=') === false) {
                $module->adv_params = plgSystemAdvancedModulesUpdateParams($module->id, $module->adv_params);
            }
            $module->adv_params = $parameters->getParams($module->adv_params, $xmlfile_assignments);
            $new_modules[$module->id] = $module;
        }
        $modules = $new_modules;
        unset($new_modules);
        foreach ($modules as $id => $module) {
            if ($module->adv_params === 0) {
                continue;
            }
            $extraparams = array();
            for ($i = 1; $i <= 5; $i++) {
                $var = 'extra' . $i;
                $extraparams[] = $var . '=' . (isset($module->adv_params->{$var}) ? $module->adv_params->{$var} : '');
            }
            if (!empty($extraparams)) {
                $module->params = implode("\n", $extraparams) . "\n" . $module->params;
            }
            $module->reverse = 0;
            // Check if module should mirror another modules assignment settings
            if ($module->published && $config->show_mirror_module) {
                $count = 0;
                while ($count++ < 10 && $module->adv_params->mirror_module) {
                    $mirror_moduleid = $module->adv_params->mirror_moduleid;
                    $module->reverse = $module->adv_params->mirror_module == 2;
                    $module->adv_params = null;
                    if ($mirror_moduleid && $mirror_moduleid != $id) {
                        if (isset($modules[$mirror_moduleid])) {
                            $module->adv_params = $modules[$mirror_moduleid]->adv_params;
                        } else {
                            $query = 'SELECT params' . ' FROM #__advancedmodules' . ' WHERE moduleid = ' . (int) $mirror_moduleid . ' LIMIT 1';
                            $db->setQuery($query);
                            $module->adv_params = $parameters->getParams($db->loadResult(), $xmlfile_assignments);
                        }
                    }
                }
            }
            if ($module->published) {
                $params = array();
                if ($module->adv_params->assignto_menuitems) {
                    $params['MenuItem'] = null;
                    $params['MenuItem']->assignment = $module->adv_params->assignto_menuitems;
                    $params['MenuItem']->selection = $module->adv_params->assignto_menuitems_selection;
                    $params['MenuItem']->params = null;
                    $params['MenuItem']->params->inc_children = $module->adv_params->assignto_menuitems_inc_children;
                    $params['MenuItem']->params->inc_noItemid = $module->adv_params->assignto_menuitems_inc_noitemid;
                }
                if ($config->show_assignto_secscats && $module->adv_params->assignto_secscats) {
                    $params['SecsCats'] = null;
                    $params['SecsCats']->assignment = $module->adv_params->assignto_secscats;
                    $params['SecsCats']->selection = $module->adv_params->assignto_secscats_selection;
                    $params['SecsCats']->params = null;
                    $incs = $module->adv_params->assignto_secscats_inc;
                    if (!(strpos($incs, '|') === false)) {
                        $incs = explode('|', $incs);
                    } else {
                        $incs = explode(',', $incs);
                    }
                    $params['SecsCats']->params->inc_sections = in_array('inc_secs', $incs);
                    $params['SecsCats']->params->inc_categories = in_array('inc_cats', $incs);
                    $params['SecsCats']->params->inc_articles = in_array('inc_arts', $incs);
                    $params['SecsCats']->params->inc_others = in_array('inc_others', $incs);
                }
                if ($config->show_assignto_articles && $module->adv_params->assignto_articles) {
                    $params['Articles'] = null;
                    $params['Articles']->assignment = $module->adv_params->assignto_articles;
                    $params['Articles']->selection = $module->adv_params->assignto_articles_selection;
                    $params['Articles']->params = null;
                    $params['Articles']->params->keywords = $module->adv_params->assignto_articles_keywords;
                }
                if ($config->show_assignto_k2cats && $module->adv_params->assignto_k2cats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'admin.k2.php')) {
                    $params['Categories_K2'] = null;
                    $params['Categories_K2']->assignment = $module->adv_params->assignto_k2cats;
                    $params['Categories_K2']->selection = $module->adv_params->assignto_k2cats_selection;
                    $params['Categories_K2']->params = null;
                    $params['Categories_K2']->params->inc_children = $module->adv_params->assignto_k2cats_inc_children;
                    $incs = $module->adv_params->assignto_k2cats_inc;
                    if (!(strpos($incs, '|') === false)) {
                        $incs = explode('|', $incs);
                    } else {
                        $incs = explode(',', $incs);
                    }
                    $params['Categories_K2']->params->inc_categories = in_array('inc_cats', $incs);
                    $params['Categories_K2']->params->inc_items = in_array('inc_items', $incs);
                }
                if ($config->show_assignto_mrcats && $module->adv_params->assignto_mrcats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_resource' . DS . 'resource.php')) {
                    $params['Categories_MR'] = null;
                    $params['Categories_MR']->assignment = $module->adv_params->assignto_mrcats;
                    $params['Categories_MR']->selection = $module->adv_params->assignto_mrcats_selection;
                    $params['Categories_MR']->params = null;
                    $params['Categories_MR']->params->inc_children = $module->adv_params->assignto_mrcats_inc_children;
                    $incs = $module->adv_params->assignto_mrcats_inc;
                    if (!(strpos($incs, '|') === false)) {
                        $incs = explode('|', $incs);
                    } else {
                        $incs = explode(',', $incs);
                    }
                    $params['Categories_MR']->params->inc_categories = in_array('inc_cats', $incs);
                    $params['Categories_MR']->params->inc_items = in_array('inc_items', $incs);
                }
                if ($config->show_assignto_zoocats && $module->adv_params->assignto_zoocats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_zoo' . DS . 'zoo.php')) {
                    $params['Categories_ZOO'] = null;
                    $params['Categories_ZOO']->assignment = $module->adv_params->assignto_zoocats;
                    $params['Categories_ZOO']->selection = $module->adv_params->assignto_zoocats_selection;
                    $params['Categories_ZOO']->params = null;
                    $params['Categories_ZOO']->params->inc_children = $module->adv_params->assignto_zoocats_inc_children;
                    $incs = $module->adv_params->assignto_zoocats_inc;
                    if (!(strpos($incs, '|') === false)) {
                        $incs = explode('|', $incs);
                    } else {
                        $incs = explode(',', $incs);
                    }
                    $params['Categories_ZOO']->params->inc_categories = in_array('inc_cats', $incs);
                    $params['Categories_ZOO']->params->inc_items = in_array('inc_items', $incs);
                }
                if ($config->show_assignto_components && $module->adv_params->assignto_components) {
                    $params['Components'] = null;
                    $params['Components']->assignment = $module->adv_params->assignto_components;
                    $params['Components']->selection = $module->adv_params->assignto_components_selection;
                }
                if ($config->show_assignto_urls && $module->adv_params->assignto_urls) {
                    $params['URL'] = null;
                    $params['URL']->assignment = $module->adv_params->assignto_urls;
                    $configuration =& JFactory::getConfig();
                    if ($configuration->getValue('config.sef') == 1) {
                        $params['URL']->selection = $module->adv_params->assignto_urls_selection_sef;
                    } else {
                        $params['URL']->selection = $module->adv_params->assignto_urls_selection;
                    }
                    $params['URL']->selection = str_replace('\\n', "\n", $params['URL']->selection);
                    $params['URL']->selection = str_replace('\\|', '|', $params['URL']->selection);
                    $params['URL']->selection = str_replace('[:REGEX_ENTER:]', '\\n', $params['URL']->selection);
                    $params['URL']->selection = explode("\n", $params['URL']->selection);
                }
                if ($config->show_assignto_browsers && $module->adv_params->assignto_browsers) {
                    $params['Browsers'] = null;
                    $params['Browsers']->assignment = $module->adv_params->assignto_browsers;
                    $params['Browsers']->params = null;
                    $params['Browsers']->selection = $module->adv_params->assignto_browsers_selection;
                }
                if ($config->show_assignto_date && $module->adv_params->assignto_date) {
                    $params['Date'] = null;
                    $params['Date']->assignment = $module->adv_params->assignto_date;
                    $params['Date']->params = null;
                    $params['Date']->params->publish_up = $module->adv_params->assignto_date_publish_up;
                    $params['Date']->params->publish_down = $module->adv_params->assignto_date_publish_down;
                }
                if ($config->show_assignto_date && $module->adv_params->assignto_seasons) {
                    $params['Seasons'] = null;
                    $params['Seasons']->assignment = $module->adv_params->assignto_seasons;
                    $params['Seasons']->selection = $module->adv_params->assignto_seasons_selection;
                    $params['Seasons']->params = null;
                    $params['Seasons']->params->hemisphere = $module->adv_params->assignto_seasons_hemisphere;
                }
                if ($config->show_assignto_date && $module->adv_params->assignto_months) {
                    $params['Months'] = null;
                    $params['Months']->assignment = $module->adv_params->assignto_months;
                    $params['Months']->selection = $module->adv_params->assignto_months_selection;
                }
                if ($config->show_assignto_date && $module->adv_params->assignto_days) {
                    $params['Days'] = null;
                    $params['Days']->assignment = $module->adv_params->assignto_days;
                    $params['Days']->selection = $module->adv_params->assignto_days_selection;
                }
                if ($config->show_assignto_date && $module->adv_params->assignto_time) {
                    $params['Time'] = null;
                    $params['Time']->assignment = $module->adv_params->assignto_time;
                    $params['Time']->params = null;
                    $params['Time']->params->publish_up = $module->adv_params->assignto_time_publish_up;
                    $params['Time']->params->publish_down = $module->adv_params->assignto_time_publish_down;
                }
                if ($config->show_assignto_usergrouplevels && $module->adv_params->assignto_usergrouplevels) {
                    $params['UserGroupLevels'] = null;
                    $params['UserGroupLevels']->assignment = $module->adv_params->assignto_usergrouplevels;
                    $params['UserGroupLevels']->selection = $module->adv_params->assignto_usergrouplevels_selection;
                }
                if ($config->show_assignto_users && $module->adv_params->assignto_users) {
                    $params['Users'] = null;
                    $params['Users']->assignment = $module->adv_params->assignto_users;
                    $params['Users']->selection = $module->adv_params->assignto_users_selection;
                }
                if ($config->show_assignto_languages && $module->adv_params->assignto_languages) {
                    $params['Languages'] = null;
                    $params['Languages']->assignment = $module->adv_params->assignto_languages;
                    $params['Languages']->selection = $module->adv_params->assignto_languages_selection;
                }
                if ($config->show_assignto_templates && $module->adv_params->assignto_templates) {
                    $params['Templates'] = null;
                    $params['Templates']->assignment = $module->adv_params->assignto_templates;
                    $params['Templates']->selection = $module->adv_params->assignto_templates_selection;
                }
                if ($config->show_assignto_php && $module->adv_params->assignto_php) {
                    $params['PHP'] = null;
                    $params['PHP']->assignment = $module->adv_params->assignto_php;
                    $params['PHP']->selection = $module->adv_params->assignto_php_selection;
                }
                $pass = $assignments->passAll($params, $module->adv_params->match_method);
                if (!$pass) {
                    $module->published = 0;
                }
                if ($module->reverse) {
                    $module->published = $module->published ? 0 : 1;
                }
            }
            $modules[$id] = $module;
        }
    }
}
Esempio n. 11
0
defined('_JEXEC') or die('Restricted access');
$mainframe =& JFactory::getApplication();
$user =& JFactory::getUser();
if (!$mainframe->isSite() && $user->get('guest') || !$user->authorize('com_content', 'edit', 'content', 'all')) {
    JError::raiseError(403, JText::_("ALERTNOTAUTH"));
}
$vars = JRequest::getVar('vars');
$option = $vars['option'];
$comp_file = JRequest::getVar('comp');
$file = dirname(__FILE__) . DS . 'components' . DS . $option . DS . $comp_file . '.xml';
$template = '';
$xml =& JFactory::getXMLParser('Simple');
$xml->loadFile($file);
if (isset($xml->document) && isset($xml->document->_children)) {
    require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
    $parameters =& NNParameters::getParameters();
    $xml_template = $parameters->getObjectFromXML($xml->document->_children);
    if (isset($xml_template->params) && isset($xml_template->params->required)) {
        require_once dirname(__FILE__) . DS . 'helper.php';
        if (!is_object($xml_template->params->required) || modAddToMenu::checkRequiredFields($xml_template->params->required, $vars)) {
            $template = $xml_template->params;
        }
    }
}
if (!$template) {
    return;
}
$lang =& JFactory::getLanguage();
$lang->load('mod_addtomenu', JPATH_ADMINISTRATOR);
$lang->load('com_menus', JPATH_ADMINISTRATOR);
$lang->load($comp_file, JPATH_ADMINISTRATOR);
Esempio n. 12
0
 /**
  * Add the page title and toolbar.
  *
  * @since	1.6
  */
 protected function addToolbar()
 {
     JRequest::setVar('hidemainmenu', true);
     $user = JFactory::getUser();
     $isNew = $this->item->id == 0;
     $checkedOut = !($this->item->checked_out == 0 || $this->item->checked_out == $user->get('id'));
     $canDo = AdvancedModulesHelper::getActions($this->state->get('filter.category_id'), $this->item->id);
     $item = $this->get('Item');
     JToolBarHelper::title(JText::sprintf('AMM_MODULE_EDIT', JText::_($this->item->module)), 'module.png');
     // If not checked out, can save the item.
     if (!$checkedOut && ($canDo->get('core.edit') || $canDo->get('core.create'))) {
         JToolBarHelper::apply('module.apply');
         JToolBarHelper::save('module.save');
     }
     if (!$checkedOut && $canDo->get('core.create')) {
         if (version_compare(JVERSION, '1.7.0', 'l')) {
             JToolBarHelper::custom('module.save2new', 'save-new.png', 'save-new_f2.png', 'JTOOLBAR_SAVE_AND_NEW', false);
         } else {
             JToolBarHelper::save2new('module.save2new');
         }
     }
     // If an existing item, can save to a copy.
     if (!$isNew && $canDo->get('core.create')) {
         if (version_compare(JVERSION, '1.7.0', 'l')) {
             JToolBarHelper::custom('module.save2copy', 'save-copy.png', 'save-copy_f2.png', 'JTOOLBAR_SAVE_AS_COPY', false);
         } else {
             JToolBarHelper::save2copy('module.save2copy');
         }
     }
     if (empty($this->item->id)) {
         JToolBarHelper::cancel('module.cancel');
     } else {
         JToolBarHelper::cancel('module.cancel', 'JTOOLBAR_CLOSE');
     }
     if ($canDo->get('core.admin')) {
         require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
         $parameters =& NNParameters::getParameters();
         $config = JComponentHelper::getParams('com_advancedmodules');
         $config = $parameters->getParams($config->toObject(), JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
         if ($config->show_config_in_item) {
             JToolBarHelper::divider();
             JToolBarHelper::preferences('com_advancedmodules');
         }
     }
     // Get the help information for the menu item.
     $lang = JFactory::getLanguage();
     $help = $this->get('Help');
     if ($lang->hasKey($help->url)) {
         $debug = $lang->setDebug(false);
         $url = JText::_($help->url);
         $lang->setDebug($debug);
     } else {
         $url = null;
     }
     JToolBarHelper::divider();
     JToolBarHelper::help($help->key, false, $url);
 }
Esempio n. 13
0
 function getAdvancedModules($Itemid)
 {
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
     $parameters =& NNParameters::getParameters();
     $db =& JFactory::getDBO();
     $query = 'SELECT m.id, m.title, m.module, m.position, m.checked_out, m.access,' . ' am.params as adv_params,' . ' g.name AS groupname' . ' FROM #__modules AS m' . ' LEFT JOIN #__advancedmodules AS am ON am.moduleid = m.id' . ' LEFT JOIN #__groups AS g ON g.id = m.access' . ' WHERE m.published = 1' . ' AND m.client_id = 0' . ' GROUP BY m.id' . ' ORDER BY m.position, m.ordering, m.id';
     $db->setQuery($query);
     if (null === ($modules = $db->loadObjectList('id'))) {
         JError::raiseWarning('SOME_ERROR_CODE', JText::_('AMM_ERROR_LOADING_MODULES') . $db->getErrorMsg());
         return false;
     }
     require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'assignments.php';
     $assignments = new NoNumberElementsAssignmentsHelper();
     $assignments->_params->Itemid = $Itemid;
     $xmlfile = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'assignments.xml';
     $ordered = array();
     foreach ($modules as $id => $module) {
         $module->adv_params = $parameters->getParams($module->adv_params, $xmlfile);
         if ($module->adv_params->assignto_menuitems) {
             $params = null;
             $params->assignment = $module->adv_params->assignto_menuitems;
             $params->selection = $module->adv_params->assignto_menuitems_selection;
             $params->params = null;
             $params->params->inc_children = $module->adv_params->assignto_menuitems_inc_children;
             $params->params->inc_noItemid = $module->adv_params->assignto_menuitems_inc_noitemid;
             $assignments->initParams($params, 'MenuItem');
             $pass = $assignments->passMenuItem($params->params, $params->selection, $params->assignment);
             if (!$pass) {
                 continue;
             }
         }
         $ordered[] = $modules[$id];
     }
     unset($modules);
     return $ordered;
 }
Esempio n. 14
0
function plgSystemAdvancedModulesPrepareModuleList(&$modules)
{
    $mainframe =& JFactory::getApplication();
    $client = $mainframe->getClientId();
    if ($client == 0) {
        $db =& JFactory::getDBO();
        jimport('joomla.filesystem.file');
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'parameters.php';
        $parameters =& NNParameters::getParameters();
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'assignments.php';
        $assignments = new NoNumberElementsAssignmentsHelper();
        $xmlfile_assignments = JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'assignments.xml';
        $config = plgSystemAdvancedModulesConfig();
        // set params for all loaded modules first
        // and make it an associated array (array id = module id)
        $new_modules = array();
        require_once JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'models' . DS . 'module.php';
        $model = new AdvancedModulesModelModule();
        foreach ($modules as $id => $module) {
            if (!isset($module->adv_params)) {
                $module->adv_params = '';
            }
            $registry = new JRegistry();
            if (strpos($module->adv_params, '"assignto_menuitems"') === false) {
                $module->adv_params = $model->initAssignments($module->id, $module, $module->adv_params);
                $registry->loadArray($module->adv_params);
            } else {
                $registry->loadString($module->adv_params);
            }
            $module->adv_params = $registry->toObject();
            $module->adv_params = $parameters->getParams($module->adv_params, $xmlfile_assignments);
            $new_modules[$module->id] = $module;
        }
        $modules = $new_modules;
        unset($new_modules);
        foreach ($modules as $id => $module) {
            if ($module->adv_params === 0) {
                continue;
            }
            $extraparams = array();
            for ($i = 1; $i <= 5; $i++) {
                $var = 'extra' . $i;
                $extraparams[$var] = isset($module->adv_params->{$var}) ? $module->adv_params->{$var} : '';
            }
            if (!empty($extraparams)) {
                $registry = new JRegistry();
                $registry->loadString($module->params);
                $module->params = $registry->toArray();
                $module->params = array_merge($module->params, $extraparams);
                $registry = new JRegistry();
                $registry->loadArray($module->params);
                $module->params = $registry->toString();
            }
            $module->reverse = 0;
            // Check if module should mirror another modules assignment settings
            if ($module->published && $config->show_mirror_module) {
                $count = 0;
                while ($count++ < 10 && isset($module->adv_params->mirror_module) && $module->adv_params->mirror_module && isset($module->adv_params->mirror_moduleid) && $module->adv_params->mirror_moduleid) {
                    $mirror_moduleid = $module->adv_params->mirror_moduleid;
                    $module->reverse = $module->adv_params->mirror_module == 2;
                    if ($mirror_moduleid) {
                        if ($mirror_moduleid == $id) {
                            $empty = new stdClass();
                            $module->adv_params = $parameters->getParams($empty, $xmlfile_assignments);
                        } else {
                            if (isset($modules[$mirror_moduleid])) {
                                $module->adv_params = $modules[$mirror_moduleid]->adv_params;
                            } else {
                                $query = 'SELECT params' . ' FROM #__advancedmodules' . ' WHERE moduleid = ' . (int) $mirror_moduleid . ' LIMIT 1';
                                $db->setQuery($query);
                                $registry = new JRegistry();
                                $registry->loadString($db->loadResult());
                                $module->adv_params = $parameters->getParams($registry->toObject(), $xmlfile_assignments);
                            }
                        }
                    }
                }
            }
            if ($module->published) {
                $params = array();
                if ($module->adv_params->assignto_menuitems) {
                    $params['MenuItem'] = new stdClass();
                    $params['MenuItem']->assignment = $module->adv_params->assignto_menuitems;
                    $params['MenuItem']->selection = $module->adv_params->assignto_menuitems_selection;
                    $params['MenuItem']->params = new stdClass();
                    $params['MenuItem']->params->inc_children = $module->adv_params->assignto_menuitems_inc_children;
                    $params['MenuItem']->params->inc_noItemid = $module->adv_params->assignto_menuitems_inc_noitemid;
                }
                if ($config->show_assignto_homepage && $module->adv_params->assignto_homepage) {
                    $params['HomePage'] = new stdClass();
                    $params['HomePage']->assignment = $module->adv_params->assignto_homepage;
                }
                if ($config->show_assignto_content) {
                    if ($module->adv_params->assignto_cats) {
                        $params['Cats'] = new stdClass();
                        $params['Cats']->assignment = $module->adv_params->assignto_cats;
                        $params['Cats']->selection = $module->adv_params->assignto_cats_selection;
                        $params['Cats']->params = new stdClass();
                        $incs = $assignments->makeArray($module->adv_params->assignto_cats_inc);
                        $params['Cats']->params->inc_categories = in_array('inc_cats', $incs);
                        $params['Cats']->params->inc_articles = in_array('inc_arts', $incs);
                        $params['Cats']->params->inc_others = in_array('inc_others', $incs);
                        $params['Cats']->params->inc_children = $module->adv_params->assignto_cats_inc_children;
                    }
                    if ($module->adv_params->assignto_articles) {
                        $params['Articles'] = new stdClass();
                        $params['Articles']->assignment = $module->adv_params->assignto_articles;
                        $params['Articles']->selection = $module->adv_params->assignto_articles_selection;
                        $params['Articles']->params = new stdClass();
                        $params['Articles']->params->keywords = $module->adv_params->assignto_articles_keywords;
                    }
                }
                /*
                if ( $config->show_assignto_fc && JFile::exists( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_flexicontent'.DS.'admin.flexicontent.php' ) ) {
                	if ( $module->adv_params->assignto_fccats ) {
                		$params['Categories_FC'] = new stdClass();
                		$params['Categories_FC']->assignment = $module->adv_params->assignto_fccats;
                		$params['Categories_FC']->selection = $module->adv_params->assignto_fccats_selection;
                		$params['Categories_FC']->params = new stdClass();
                		$params['Categories_FC']->params->inc_children = $module->adv_params->assignto_fccats_inc_children;
                		$incs = $assignments->makeArray( $module->adv_params->assignto_fccats_inc );
                		$params['Categories_FC']->params->inc_categories = in_array( 'inc_cats', $incs );
                		$params['Categories_FC']->params->inc_items = in_array( 'inc_items', $incs );
                	}
                	if ( $module->adv_params->assignto_fctags ) {
                		$params['Tags_FC'] = new stdClass();
                		$params['Tags_FC']->assignment = $module->adv_params->assignto_fctags;
                		$params['Tags_FC']->selection = $module->adv_params->assignto_fctags_selection;
                		$params['Tags_FC']->params = new stdClass();
                		$incs = $assignments->makeArray( $module->adv_params->assignto_fctags_inc );
                		$params['Tags_FC']->params->inc_tags = in_array( 'inc_tags', $incs );
                		$params['Tags_FC']->params->inc_items = in_array( 'inc_items', $incs );
                	}
                	if ( $module->adv_params->assignto_fctypes ) {
                		$params['Types_FC'] = new stdClass();
                		$params['Types_FC']->assignment = $module->adv_params->assignto_fctypes;
                		$params['Types_FC']->selection = $module->adv_params->assignto_fctypes_selection;
                		$params['Types_FC']->params = new stdClass();
                	}
                	if ( $module->adv_params->assignto_fcitems ) {
                		$params['Items_FC'] = new stdClass();
                		$params['Items_FC']->assignment = $module->adv_params->assignto_fcitems;
                		$params['Items_FC']->selection = $module->adv_params->assignto_fcitems_selection;
                	}
                }
                if ( $config->show_assignto_k2 && JFile::exists( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_k2'.DS.'admin.k2.php' ) ) {
                	if ( $module->adv_params->assignto_k2cats ) {
                		$params['Categories_K2'] = new stdClass();
                		$params['Categories_K2']->assignment = $module->adv_params->assignto_k2cats;
                		$params['Categories_K2']->selection = $module->adv_params->assignto_k2cats_selection;
                		$params['Categories_K2']->params = new stdClass();
                		$params['Categories_K2']->params->inc_children = $module->adv_params->assignto_k2cats_inc_children;
                		$incs = $assignments->makeArray( $module->adv_params->assignto_k2cats_inc );
                		$params['Categories_K2']->params->inc_categories = in_array( 'inc_cats', $incs );
                		$params['Categories_K2']->params->inc_items = in_array( 'inc_items', $incs );
                	}
                	if ( $module->adv_params->assignto_k2tags ) {
                		$params['Tags_K2'] = new stdClass();
                		$params['Tags_K2']->assignment = $module->adv_params->assignto_k2tags;
                		$params['Tags_K2']->selection = $module->adv_params->assignto_k2tags_selection;
                		$params['Tags_K2']->params = new stdClass();
                		$incs = $assignments->makeArray( $module->adv_params->assignto_k2tags_inc );
                		$params['Tags_K2']->params->inc_tags = in_array( 'inc_tags', $incs );
                		$params['Tags_K2']->params->inc_items = in_array( 'inc_items', $incs );
                	}
                	if ( $module->adv_params->assignto_k2items ) {
                		$params['Items_K2'] = new stdClass();
                		$params['Items_K2']->assignment = $module->adv_params->assignto_k2items;
                		$params['Items_K2']->selection = $module->adv_params->assignto_k2items_selection;
                	}
                }
                if ( $config->show_assignto_mr && $module->adv_params->assignto_mrcats && JFile::exists( JPATH_ADMINISTRATOR.DS.'components'.DS.'com_resource'.DS.'resource.php' ) ) {
                	$params['Categories_MR'] = new stdClass();
                	$params['Categories_MR']->assignment = $module->adv_params->assignto_mrcats;
                	$params['Categories_MR']->selection = $module->adv_params->assignto_mrcats_selection;
                	$params['Categories_MR']->params = new stdClass();
                	$params['Categories_MR']->params->inc_children = $module->adv_params->assignto_mrcats_inc_children;
                	$incs = $assignments->makeArray( $module->adv_params->assignto_mrcats_inc );
                	$params['Categories_MR']->params->inc_categories = in_array( 'inc_cats', $incs );
                	$params['Categories_MR']->params->inc_items = in_array( 'inc_items', $incs );
                }
                */
                if ($config->show_assignto_zoo && $module->adv_params->assignto_zoocats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_zoo' . DS . 'zoo.php')) {
                    $params['Categories_ZOO'] = new stdClass();
                    $params['Categories_ZOO']->assignment = $module->adv_params->assignto_zoocats;
                    $params['Categories_ZOO']->selection = $module->adv_params->assignto_zoocats_selection;
                    $params['Categories_ZOO']->params = new stdClass();
                    $params['Categories_ZOO']->params->inc_children = $module->adv_params->assignto_zoocats_inc_children;
                    $incs = $assignments->makeArray($module->adv_params->assignto_zoocats_inc);
                    $params['Categories_ZOO']->params->inc_apps = in_array('inc_apps', $incs);
                    $params['Categories_ZOO']->params->inc_categories = in_array('inc_cats', $incs);
                    $params['Categories_ZOO']->params->inc_items = in_array('inc_items', $incs);
                }
                if ($config->show_assignto_components && $module->adv_params->assignto_components) {
                    $params['Components'] = new stdClass();
                    $params['Components']->assignment = $module->adv_params->assignto_components;
                    $params['Components']->selection = $module->adv_params->assignto_components_selection;
                }
                if ($config->show_assignto_urls && $module->adv_params->assignto_urls) {
                    $params['URL'] = new stdClass();
                    $params['URL']->assignment = $module->adv_params->assignto_urls;
                    $configuration =& JFactory::getConfig();
                    if ($config->use_sef == 1 || $config->use_sef == 2 && $configuration->getValue('config.sef') == 1) {
                        $params['URL']->selection = $module->adv_params->assignto_urls_selection_sef;
                    } else {
                        $params['URL']->selection = $module->adv_params->assignto_urls_selection;
                    }
                    $params['URL']->selection = explode("\n", $params['URL']->selection);
                }
                if ($config->show_assignto_browsers && $module->adv_params->assignto_browsers) {
                    $params['Browsers'] = new stdClass();
                    $params['Browsers']->assignment = $module->adv_params->assignto_browsers;
                    $params['Browsers']->selection = $module->adv_params->assignto_browsers_selection;
                }
                if ($config->show_assignto_date) {
                    if ($module->adv_params->assignto_date) {
                        $params['Date'] = new stdClass();
                        $params['Date']->assignment = $module->adv_params->assignto_date;
                        $params['Date']->params = new stdClass();
                        $params['Date']->params->publish_up = $module->adv_params->assignto_date_publish_up;
                        $params['Date']->params->publish_down = $module->adv_params->assignto_date_publish_down;
                    }
                    if ($module->adv_params->assignto_seasons) {
                        $params['Seasons'] = new stdClass();
                        $params['Seasons']->assignment = $module->adv_params->assignto_seasons;
                        $params['Seasons']->selection = $module->adv_params->assignto_seasons_selection;
                        $params['Seasons']->params = new stdClass();
                        $params['Seasons']->params->hemisphere = $module->adv_params->assignto_seasons_hemisphere;
                    }
                    if ($module->adv_params->assignto_months) {
                        $params['Months'] = new stdClass();
                        $params['Months']->assignment = $module->adv_params->assignto_months;
                        $params['Months']->selection = $module->adv_params->assignto_months_selection;
                    }
                    if ($module->adv_params->assignto_days) {
                        $params['Days'] = new stdClass();
                        $params['Days']->assignment = $module->adv_params->assignto_days;
                        $params['Days']->selection = $module->adv_params->assignto_days_selection;
                    }
                    if ($module->adv_params->assignto_time) {
                        $params['Time'] = new stdClass();
                        $params['Time']->assignment = $module->adv_params->assignto_time;
                        $params['Time']->params = new stdClass();
                        $params['Time']->params->publish_up = $module->adv_params->assignto_time_publish_up;
                        $params['Time']->params->publish_down = $module->adv_params->assignto_time_publish_down;
                    }
                }
                if ($config->show_assignto_usergrouplevels && $module->adv_params->assignto_usergrouplevels) {
                    $params['UserGroupLevels'] = new stdClass();
                    $params['UserGroupLevels']->assignment = $module->adv_params->assignto_usergrouplevels;
                    $params['UserGroupLevels']->selection = $module->adv_params->assignto_usergrouplevels_selection;
                }
                if ($config->show_assignto_users && $module->adv_params->assignto_users) {
                    $params['Users'] = new stdClass();
                    $params['Users']->assignment = $module->adv_params->assignto_users;
                    $params['Users']->selection = $module->adv_params->assignto_users_selection;
                }
                if ($config->show_assignto_languages && $module->adv_params->assignto_languages) {
                    $params['Languages'] = new stdClass();
                    $params['Languages']->assignment = $module->adv_params->assignto_languages;
                    $params['Languages']->selection = $module->adv_params->assignto_languages_selection;
                }
                if ($config->show_assignto_templates && $module->adv_params->assignto_templates) {
                    $params['Templates'] = new stdClass();
                    $params['Templates']->assignment = $module->adv_params->assignto_templates;
                    $params['Templates']->selection = $module->adv_params->assignto_templates_selection;
                }
                if ($config->show_assignto_php && $module->adv_params->assignto_php) {
                    $params['PHP'] = new stdClass();
                    $params['PHP']->assignment = $module->adv_params->assignto_php;
                    $params['PHP']->selection = $module->adv_params->assignto_php_selection;
                }
                $pass = $assignments->passAll($params, $module->adv_params->match_method);
                if (!$pass) {
                    $module->published = 0;
                }
                if ($module->reverse) {
                    $module->published = $module->published ? 0 : 1;
                }
            }
            $modules[$id] = $module;
        }
    }
}
    /**
     * Writes the edit form for new and existing module
     *
     * A new record is defined when <var>$row</var> is passed with the <var>id</var>
     * property set to 0.
     * @param JTableCategory The category object
     * @param array <p>The modules of the left side.  The array elements are in the form
     * <var>$leftorder[<i>order</i>] = <i>label</i></var>
     * where <i>order</i> is the module order from the db table and <i>label</i> is a
     * text label associciated with the order.</p>
     * @param array See notes for leftorder
     * @param array An array of select lists
     * @param object Parameters
     */
    function edit(&$model, &$row, &$orders2, &$lists, &$params, $client)
    {
        JRequest::setVar('hidemainmenu', 1);
        // clean item data
        JFilterOutput::objectHTMLSafe($row, ENT_QUOTES, 'content');
        if ($client->id != 1) {
            $parameters =& NNParameters::getParameters();
            $config = JComponentHelper::getParams('com_advancedmodules');
            $config = $parameters->getParams($config->_raw, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
        }
        $document =& JFactory::getDocument();
        $editor =& JFactory::getEditor();
        require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php';
        $version = NoNumberVersions::getXMLVersion(null, null, null, 1);
        $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js' . $version);
        $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/elements/toggler.js' . $version);
        $script = "\n\t\t\tfunction submitbutton( pressbutton ) {\n\t\t\t\tif ( ( pressbutton == 'save' || pressbutton == 'apply' ) && ( document.adminForm.title.value == '' ) ) {\n\t\t\t\t\talert( '" . JText::_('Module must have a title', true) . "' );\n\t\t\t\t} else {\n\t\t\t\t\tif ( pressbutton == 'save' ) {\n\t\t\t\t\t\tdocument.adminForm.target = '_parent';\n\t\t\t\t\t}\n\t\t";
        if ($row->module == '' || $row->module == 'mod_custom') {
            $script .= $editor->save('content');
        }
        $script .= "\n\t\t\t\t\tsubmitform( pressbutton );\n\t\t\t\t}\n\t\t\t}\n\t\t\tvar originalOrder \t= '" . $row->ordering . "';\n\t\t\tvar originalPos \t= '" . $row->position . "';\n\t\t\tvar orders \t\t\t= new Array();\t// array in the format [key,value,text]\n\t\t";
        $i = 0;
        foreach ($orders2 as $k => $items) {
            foreach ($items as $v) {
                $script .= "\n" . '	orders[' . $i++ . '] = new Array( "' . $k . '","' . $v->value . '","' . $v->text . '" );';
            }
        }
        $script .= "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tif ( !nnTogglerSet ) {\n\t\t\t\t\tnnTogglerSet = new nnToggler();\n\t\t\t\t}\n\t\t\t});\n\t\t";
        if ($client->id != 1) {
            if ($config->show_color) {
                $colors = explode(',', $config->main_colors);
                foreach ($colors as $i => $c) {
                    $colors[$i] = strtoupper('#' . preg_replace('#[^a-z0-9]#i', '', $c));
                }
                $script .= "\n\t\t\t\t\tmainColors = new Array( '" . implode("', '", $colors) . "' );";
            }
        }
        $document->addScriptDeclaration($script);
        $tmpl = JRequest::getCmd('tmpl');
        if ($tmpl == 'component') {
            HTML_modules::placeModalHeader('edit');
        }
        jimport('joomla.html.pane');
        // TODO: allowAllClose should default true in J!1.6, so remove the array when it does.
        $pane =& JPane::getInstance('sliders', array('allowAllClose' => true));
        JHTML::_('behavior.tooltip');
        ?>
		<form action="<?php 
        echo JRoute::_('index.php');
        ?>
" method="post" name="adminForm">
			<input type="hidden" name="option" value="com_advancedmodules" />
			<input type="hidden" name="tmpl" value="<?php 
        echo $tmpl;
        ?>
" />
			<input type="hidden" name="id" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="cid[]" value="<?php 
        echo $row->id;
        ?>
" />
			<input type="hidden" name="original" value="<?php 
        echo $row->ordering;
        ?>
" />
			<input type="hidden" name="module" value="<?php 
        echo $row->module;
        ?>
" />
			<input type="hidden" name="task" value="" />
			<input type="hidden" name="client" value="<?php 
        echo $client->id;
        ?>
" />
			<?php 
        echo JHTML::_('form.token');
        ?>

		<div class="col width-50">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('Details');
        ?>
</legend>

				<table class="admintable" cellspacing="1">
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Module Type');
        ?>
:
						</td>
						<td>
							<strong>
								<?php 
        echo JText::_($row->module);
        ?>
							</strong>
						</td>
					</tr>
					<tr>
						<td class="key">
							<label for="title">
								<?php 
        echo JText::_('Title');
        ?>
:
							</label>
						</td>
						<td>
							<input class="text_area" type="text" name="title" id="title" size="50" value="<?php 
        echo $row->title;
        ?>
" />
						</td>
					</tr>
					<tr>
						<td width="100" class="key">
							<?php 
        echo JText::_('Show title');
        ?>
:
						</td>
						<td>
							<?php 
        echo $lists['showtitle'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Published');
        ?>
:
						</td>
						<td>
							<?php 
        echo $lists['published'];
        ?>
						</td>
					</tr>
				<?php 
        if ($client->id != 1) {
            if ($config->show_hideempty) {
                ?>
					<tr>
						<td valign="top" class="key">
							<label for="hideempty" class="hasTip" title="<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY');
                ?>
::<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY_DESC');
                ?>
">
								<?php 
                echo JText::_('AMM_HIDE_IF_EMPTY', 0);
                ?>
:
							</label>
						</td>
						<td>
							<?php 
                echo $lists['hideempty'];
                ?>
						</td>
					</tr>
				<?php 
            }
        }
        ?>
					<tr>
						<td valign="top" class="key">
							<label for="position" class="hasTip" title="<?php 
        echo JText::_('MODULE_POSITION_TIP_TITLE', true);
        ?>
::<?php 
        echo JText::_('MODULE_POSITION_TIP_TEXT', true);
        ?>
">
								<?php 
        echo JText::_('Position');
        ?>
:
							</label>
						</td>
						<td>
							<input type="text" id="position" name="position" value="<?php 
        echo $row->position;
        ?>
"  onchange="form.position_select.value=this.value" />
							<select id="position_select" onchange="document.getElementById('position').value=this.options[this.selectedIndex].value;this.value=''" style="background-color:#F0F0F0;">
							<?php 
        echo '<option value="">-- ' . JText::_('Select Position') . ' --</option>';
        $positions = $model->getPositions();
        foreach ($positions as $position) {
            echo '<option value="' . $position . '">' . $position . '</option>';
        }
        ?>
							</select>
						</td>
					</tr>

					<tr>
						<td valign="top"  class="key">
							<label for="ordering">
								<?php 
        echo JText::_('Order');
        ?>
:
							</label>
						</td>
						<td>
							<script language="javascript" type="text/javascript">
							<!--
							writeDynaList( 'class="inputbox" name="ordering" id="ordering" size="1"', orders, originalPos, originalPos, originalOrder );
							//-->
							</script>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<label for="access">
								<?php 
        echo JText::_('AMM_ACCESS_LEVEL');
        ?>
:
							</label>
						</td>
						<td>
							<?php 
        echo $lists['access'];
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('ID');
        ?>
:
						</td>
						<td>
							<?php 
        echo $row->id;
        ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<?php 
        echo JText::_('Description');
        ?>
:
						</td>
						<td>
							<?php 
        echo JText::_(html_entity_decode($row->description, ENT_COMPAT, 'UTF-8'));
        ?>
						</td>
					</tr>
				<?php 
        if ($client->id != 1) {
            ?>
					<tr>
						<td valign="top" class="key">
							<label class="hasTip" title="<?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION');
            ?>
::<?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION_DESC');
            ?>
"><?php 
            echo JText::_('AMM_CUSTOM_DESCRIPTION');
            ?>
:</label>
						</td>
						<td>
							<?php 
            echo $lists['tooltip'];
            ?>
						</td>
					</tr>
					<tr>
						<td valign="top" class="key">
							<label class="hasTip" title="<?php 
            echo JText::_('AMM_COLOR');
            ?>
::<?php 
            echo JText::_('AMM_COLOR_DESC');
            ?>
"><?php 
            echo JText::_('AMM_COLOR');
            ?>
:</label>
						</td>
						<td>
							<?php 
            echo $lists['color'];
            ?>
						</td>
					</tr>
				<?php 
        }
        ?>
				</table>
			</fieldset>
		</div>

		<div class="col width-50">
			<fieldset class="adminform">
				<legend><?php 
        echo JText::_('Parameters');
        ?>
</legend>

				<?php 
        echo $pane->startPane("menu-pane");
        echo $pane->startPanel(JText::_('Module Parameters'), "param-page");
        $p = $params;
        $params = $p->render('params');
        if ($params) {
            echo $params;
            if ($client->id != 1) {
                echo $lists['extra'];
            }
        } else {
            if ($client->id != 1 && $lists['extra']) {
                echo $lists['extra'];
            } else {
                echo "<div style=\"text-align: center; padding: 5px; \">" . JText::_('There are no parameters for this item') . "</div>";
            }
        }
        echo $pane->endPanel();
        if ($p->getNumParams('advanced')) {
            echo $pane->startPanel(JText::_('Advanced Parameters'), "advanced-page");
            $params = $p->render('params', 'advanced');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no advanced parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($p->getNumParams('legacy')) {
            echo $pane->startPanel(JText::_('Legacy Parameters'), "legacy-page");
            $params = $p->render('params', 'legacy');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no legacy parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($p->getNumParams('other')) {
            echo $pane->startPanel(JText::_('Other Parameters'), "other-page");
            $params = $p->render('params', 'other');
            if ($params) {
                echo $params;
            } else {
                echo "<div  style=\"text-align: center; padding: 5px; \">" . JText::_('There are no other parameters for this item') . "</div>";
            }
            echo $pane->endPanel();
        }
        if ($client->id != 1) {
            echo $pane->startPanel(JText::_('AMM_MODULE_ASSIGNMENT'), "assignment-page");
            echo HTML_modules::renderAssignments($lists, $config);
            echo $pane->endPanel();
        }
        echo $pane->endPane();
        ?>
			</fieldset>
		</div>
		<div class="clr"></div>

		<?php 
        if (!$row->module || $row->module == 'custom' || $row->module == 'mod_custom') {
            ?>
			<fieldset class="adminform">
				<legend><?php 
            echo JText::_('Custom Output');
            ?>
</legend>

				<?php 
            // parameters : areaname, content, width, height, cols, rows
            echo $editor->display('content', $row->content, '100%', '400', '60', '20', array('pagebreak', 'readmore'));
            ?>

			</fieldset>
			<?php 
        }
        ?>
		</form>
	<?php 
    }
 function renderAssignments(&$lists)
 {
     jimport('joomla.filesystem.file');
     // Loads English language file as fallback (for undefined stuff in other language file)
     $file = JPATH_ADMINISTRATOR . DS . 'language' . DS . 'en-GB' . DS . 'en-GB.com_advancedmodules.ini';
     $lang =& JFactory::getLanguage();
     $lang->_load($file, 'com_advancedmodules', 0);
     $parameters =& NNParameters::getParameters();
     $config = JComponentHelper::getParams('com_advancedmodules');
     $config = $parameters->getParams($config->_raw, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_advancedmodules' . DS . 'config.xml');
     if ($config->show_mirror_module) {
         echo $lists['assignments']->render('advancedparams', 'mirror_module');
         echo '<div id="' . rand(1000000, 9999999) . '___mirror_module.0" class="nntoggler" style="visibility: hidden;">';
     } else {
         echo '<div>';
     }
     if ($config->show_match_method && ($config->show_assignto_secscats || $config->show_assignto_articles || $config->show_assignto_k2cats || $config->show_assignto_mrcats || $config->show_assignto_zoocats || $config->show_assignto_components || $config->show_assignto_urls || $config->show_assignto_browser || $config->show_assignto_date || $config->show_assignto_usergrouplevels || $config->show_assignto_users || $config->show_assignto_languages || $config->show_assignto_templates || $config->show_assignto_php)) {
         echo $lists['assignments']->render('advancedparams', 'match_method');
     }
     echo $lists['assignments']->render('advancedparams', 'assignto_menuitems');
     if ($config->show_assignto_secscats || $config->show_assignto_articles || $config->show_assignto_k2cats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'admin.k2.php') || $config->show_assignto_mrcats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_resource' . DS . 'resource.php') || $config->show_assignto_zoocats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_zoo' . DS . 'zoo.php')) {
         echo $lists['assignments']->render('advancedparams', 'assignto_content_open');
         if ($config->show_assignto_secscats) {
             echo $lists['assignments']->render('advancedparams', 'assignto_secscats');
         }
         if ($config->show_assignto_articles) {
             echo $lists['assignments']->render('advancedparams', 'assignto_articles');
         }
         if ($config->show_assignto_k2cats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_k2' . DS . 'admin.k2.php')) {
             echo $lists['assignments']->render('advancedparams', 'assignto_k2cats');
         }
         if ($config->show_assignto_mrcats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_resource' . DS . 'resource.php')) {
             echo $lists['assignments']->render('advancedparams', 'assignto_mrcats');
         }
         if ($config->show_assignto_zoocats && JFile::exists(JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_zoo' . DS . 'zoo.php')) {
             echo $lists['assignments']->render('advancedparams', 'assignto_zoocats');
         }
         echo $lists['assignments']->render('advancedparams', 'assignto_content_close');
     }
     if ($config->show_assignto_components) {
         echo $lists['assignments']->render('advancedparams', 'assignto_components');
     }
     if ($config->show_assignto_urls) {
         echo $lists['assignments']->render('advancedparams', 'assignto_urls');
     }
     if ($config->show_assignto_browsers) {
         echo $lists['assignments']->render('advancedparams', 'assignto_browsers');
     }
     if ($config->show_assignto_date) {
         echo $lists['assignments']->render('advancedparams', 'assignto_date');
     }
     if ($config->show_assignto_usergrouplevels) {
         echo $lists['assignments']->render('advancedparams', 'assignto_usergrouplevels');
     }
     if ($config->show_assignto_users) {
         echo $lists['assignments']->render('advancedparams', 'assignto_users');
     }
     if ($config->show_assignto_languages) {
         echo $lists['assignments']->render('advancedparams', 'assignto_languages');
     }
     if ($config->show_assignto_templates) {
         echo $lists['assignments']->render('advancedparams', 'assignto_templates');
     }
     if ($config->show_assignto_php) {
         echo $lists['assignments']->render('advancedparams', 'assignto_php');
     }
     echo '</div>';
 }