function fetchElement($name, $value, &$node, $control_name) { $doc =& JFactory::getDocument(); $doc->addScript("http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"); $doc->addScript("http://ajax.googleapis.com/ajax/libs/jqueryui/1.7/jquery-ui.min.js"); jimport('joomla.html.pane'); jimport('joomla.filter.filteroutput'); // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $tab =& JPane::getInstance('tabs'); $url =& JURI::getInstance(); $query = $url->getQuery(true); $return = null; $group = $node['group']; $position = $this->_parent->get($node['position'], 'insertAfter'); $id = JRequest::getInt('id'); if (!$id) { $id = reset(JRequest::getVar('cid', array())); } $db =& JFactory::getDBO(); $query = 'SELECT params' . ' FROM #__modules' . ' WHERE id =' . $id; $db->setQuery($query); $values = $db->loadResult(); print_r($values); $loop = new JParameter($values, JPATH_ROOT . DS . 'modules' . DS . 'mod_ninjatabs' . DS . 'mod_ninjatabs.xml'); //In order allow new input elements dynamically from other functions and loop them we put it in a hidden div echo '<div id="ajax-' . $name . '" style="display:none;">' . $tab->startPanel(JText::_('BACKENDTABTITLE'), "tab") . $loop->render('params', $group) . $tab->endPanel() . '</div>'; //Create variables to avoid conflicts if more than one dynLoop are rolling and more. $jqname = $name; $jqhtml = $loop->render('params', $group); $values = explode("\n", $values); $defaults = array(); $i = null; $c = 1; $count = count($values); //print_r($values); foreach ($values as $value) { $tmp = split('[=]', $value); if (isset($tmp[0])) { $jqparam = array($tmp[0]); foreach ($jqparam as $key => $default) { $jqparam = $default; } } else { $jqparam = null; } $i = $count === $c ? "\n" : ",\n"; if (isset($tmp[1]) && isset($jqparam)) { $jqvalue = array($tmp[1]); foreach ($jqvalue as $key => $default) { $default = $this->javascriptHTML($default); $defaults[] = "\t\t\t\t\t{$jqparam}: \"{$default}\""; } } } $defaults = implode(",\n", $defaults); $script = "\n\t\t\tjQuery.noConflict();\n\n\t\t\tjQuery(document).ready(function(\$){\n\t\t\t\t\$('#dynTabs').closest('tr').addClass('delete-me');\n\t\t\t\t\$('#dynTabs').insertBefore(\$('#menu-pane').children().eq(0));\n\t\t\t\t\$('tr.delete-me').remove();\n\t\t\t\tvar loopTimes\t= \$('#{$control_name}{$control}').val();\n\t\t\t\tvar defaults = {\n{$defaults}\n\t\t\t\t\t\t};\n\t\t\t\tvar loopOnLoad = function(loopTimes, start) \n\t\t\t\t{\t\n\t\t\t\t\tvar limitstart = \$('#dynTabs dt').length;\n\t\t\t\t\tvar current = ' ';\n\t\t\t\t\t\n\t\t\t\t\t\$('#dynTabs .current').fadeOut;\n\t\t\t\t\t\n\t\t\t\t\tvar i=0;\n\t\t\t\t\tfor (i=1;i<=loopTimes;i++)\n\t\t\t\t\t{\n\t\t\t\t\t\t\t\$('#ajax-{$name}').children().eq(0).clone().attr('id', ('tab-'+(i+limitstart))).appendTo('#dynTabs .tabs');\n\t\t\t\t\t\t\t\$('#ajax-{$name}').children().eq(1).clone().appendTo('#dynTabs .tabs').hide();\n\t\t\t\t\t}\n\t\t\t\t\t\$('#dynTabs dt.open').show();\n\n\t\t\t\t\t\$('#dynTabs dt').children().each(function(i){\n\t\t\t\t\t\tvar no = i+1;\n\t\t\t\t\t\t\$(this).html('Tab <span>'+(no)+'</span>');\n\t\t\t\t\t});\n\t\t\t\t\n\t\t\t\t\t\$('#dynTabs dd').each(function(i){\n\t\t\t\t\tvar countLoop = i;\n\t\t\t\t\t\t\$('#dynTabs dd:eq('+i+') .paramlist_value').each(function(i){\n\t\t\t\t\t\t\t\$(this).contents().filter(':input').each(function(i){\n\t\t\t\t\t\t\t\tfunction thisName(str) {\n\t\t\t\t\t\t\t\t\treturn str.replace(/^params\\[+|\\]+\$/g, '');\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\$(this).attr('name', ('params['+thisName(\$(this).attr('name'))+countLoop+']'));\n\t\t\t\t\t\t\t});\n\t\t\t\t\t\t});\n\t\t\t\t\t});\n\t\t\t\t\tfor(key in defaults) {\n\t\t\t\t\t\t\$('[name=\"params\\['+key+'\\]\"]:not(:radio, )').not('#{$control_name}{$control}').val(defaults[key]);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t\n\t\t\t\talert('nei nei nei!!!!');\n\t\t\t\t\n\t\t\t\t\n\t\t\t\tloopOnLoad(loopTimes);\n\t\t\t\t\n\t\t\t\t\$('#{$control_name}{$control}').change(function(){\n\t\t\t\t\tif((\$('#{$control_name}{$control}').val())>(\$('#dynTabs dd').length)){\n\t\t\t\t\t\tloopOnLoad( ( \$('#{$control_name}{$control}').val() ) - ( \$('#dynTabs dd').length ), \$('#dynTabs dd').length );\n\t\t\t\t\t}\n\t\t\t\t});\n\t\t\t\t\n\t\t\t});"; $doc->addScriptDeclaration($script); return '<div id="dynTabs" style="margin-bottom: 3px;">' . $tab->startPane('dynLoop') . $tab->endPane() . '</div>'; }
function render($group = '_default') { $paramsdefs = JPATH_ADMINISTRATOR . "/components/" . $this->component_name . "/config.xml"; $paramsdata = JComponentHelper::getParams($this->component_name); $params = new JParameter($paramsdata->toString(), $paramsdefs); echo $params->render('params', $group); }
/** * Render a parameter * * @param JParameter $parameter * @param KConfig $config * @return string */ protected function _render($parameter, $config) { $params = $parameter->getParams($config->name, $config->group); foreach ($params as $key => $param) { $params[$key] = array($param[0] => $param[1]); } return $this->_template->renderHelper('ui.form', $params[0]); return $parameter->render($config->name, $config->group); }
/** * Method to render a given parameters form. * * @param string $name The name of the array for form elements. * @param string $ini An INI formatted string. * @param string $file The XML file to render. * @return string A HTML rendered parameters form. */ public function params($name, $ini, $file) { jimport('joomla.html.parameter'); // Load and render the parameters $path = JPATH_COMPONENT . DS . $file; $params = new JParameter($ini, $path); $output = $params->render($name); return $output; }
/** * render paramters form * * @return string */ function renderForm($params = array(), $fileName = 'form') { // look up configuration file which build-in this plugin or the tempate used. $path = $this->getCurrentPath() . $fileName . '.xml'; if (file_exists($path)) { $params = new JParameter($params, $path); $content = $params->render('params'); return $content; } return; }
function display($tpl = null) { $app = JFactory::getApplication(); $user = JFactory::getUser(); JHTML::_('behavior.tooltip'); //get vars $cid = JRequest::getVar('cid'); $field_type = JRequest::getVar('field_type', 0); //Get data from the model $model = $this->getModel(); if (FLEXI_J16GE) { $form = $this->get('Form'); } else { $row =& $this->get('Field'); //Import File system jimport('joomla.filesystem.file'); // Create the form $pluginpath = JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . $field_type . '.xml'; if (JFile::exists($pluginpath)) { $form = new JParameter('', $pluginpath); } else { $form = new JParameter('', JPATH_PLUGINS . DS . 'flexicontent_fields' . DS . 'core.xml'); } $form->loadINI($row->attribs); } $isnew = FLEXI_J16GE ? !$form->getValue('id') : !$row->id; // fail if checked out not by 'me' if (!$isnew) { if ($model->isCheckedOut($user->get('id'))) { JError::raiseWarning('SOME_ERROR_CODE', $row->name . ' ' . JText::_('FLEXI_EDITED_BY_ANOTHER_ADMIN')); $app->redirect('index.php?option=com_flexicontent&view=fields'); } } if ($field_type) { if (!FLEXI_J16GE) { echo $form->render('params', 'group-' . $field_type); } else { foreach ($form->getFieldset('group-' . $field_type) as $field) { echo '<fieldset class="panelform">' . $field->label . $field->input . '</fieldset>' . "\n"; } } } else { echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_('FLEXI_APPLY_TO_SEE_THE_PARAMETERS') . "</span><br /><br />"; } //parent::display($tpl); }
function getSystemParams($path) { $params = null; $item = $this->getModulesData(); if (isset($item->params)) { $params = new JParameter($item->params); } else { $params = new JParameter(""); } if (file_exists($path)) { $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadFile($path)) { $document =& $xml->document; $params->setXML($document->getElementByPath('state/params')); } } return $params->render('params'); }
function fetchElement($name, $value, &$node, $control_name) { $parent =& $this->_parent; $childParameter = new JParameter($parent->_raw); $paths = $parent->_elementPath; if (is_array($paths)) foreach ($paths as $path) $childParameter->addElementPath($path); $childParameter->setXML($node); $visible = $node->attributes('visible'); $prefix = $node->attributes('prefix'); $id = 'group_' . $prefix . '_' . $node->attributes('group_id'); return sprintf('<div id="%s" class="el-group" style="display: %s;"><div class="el-group-header"><h4>%s</h4></div><div>%s</div></div>', $id, $visible ? 'block' : 'none', JText::_($node->attributes('label')), $childParameter->render($control_name)); }
function fetchElement($name, $value, &$node, $control_name) { jimport('joomla.html.pane'); // TODO: allowAllClose should default true in J!1.6, so remove the array when it does. $panel =& JPane::getInstance('sliders'); $return = ''; if ($this->_parent->get('dynXMLStyle')) { $return .= '</td></tr></tbody></table>'; $return .= $panel->endPanel(); } $id = JRequest::getVar('id', 0, 'method', 'int'); if (!$id) { $id = reset(JRequest::getVar('cid', array(0))); } $db =& JFactory::getDBO(); $query = 'SELECT params' . ' FROM #__modules' . ' WHERE id =' . $id; $db->setQuery($query); $values = $db->loadResult(); //Get the module name, in a slightly hacky way. $module = JRequest::getWord('module'); $mod =& JTable::getInstance('Module', 'JTable'); if ($id) { $mod->load($id); $modname = $mod->module; } elseif ($module) { $modname = $module; } $dynXML = new JParameter($values, JPATH_ROOT . DS . 'modules' . DS . $modname . DS . 'tmpl' . DS . $this->_parent->get('layout') . '.xml'); if ($this->_parent->get('dynXMLStyle')) { $return .= $panel->startPanel(JText::sprintf('LAYOUTPARAMS', $this->_parent->get('layout'), $this->_parent->get('style')), "layout"); } $return .= $dynXML->render('params'); if ($this->_parent->get('dynXMLStyle')) { $return .= '<table class="paramlist admintable" width="100%" cellspacing="1"><tbody>'; } return $return; }
function getSystemParams($xmlstring) { // Initialize variables $params = null; $item = $this->getDatabaseValue(); if (isset($item->params)) { $params = new JParameter($item->params); //update value to make it compatible with old parameter if (!$params->get('mega_subcontent_mod_modules', '') && $params->get('mega_subcontent-mod-modules')) { $params->set('mega_subcontent_mod_modules', $params->get('mega_subcontent-mod-modules')); } if (!$params->get('mega_subcontent_pos_positions', '') && $params->get('mega_subcontent-pos-positions')) { $params->set('mega_subcontent_pos_positions', $params->get('mega_subcontent-pos-positions')); } } else { $params = new JParameter(""); } $xml =& JFactory::getXMLParser('Simple'); if ($xml->loadString($xmlstring)) { $document =& $xml->document; $params->setXML($document->getElementByPath('state/params')); } return $params->render('params'); }
/** * Ajax method to display the application settings * * @params $id Int Application id. * @params $appName String Application element **/ public function ajaxShowSettings($id, $appName) { // Check permissions $my =& JFactory::getUser(); if ($my->id == 0) { return $this->ajaxBlockUnregister(); } $objResponse = new JAXResponse(); $appsModel = CFactory::getModel('apps'); $lang =& JFactory::getLanguage(); $lang->load('plg_' . JString::strtolower($appName), JPATH_ROOT . DS . 'administrator'); $xmlPath = JPATH_PLUGINS . DS . 'community' . DS . $appName . DS . 'config.xml'; jimport('joomla.filesystem.file'); if (JFile::exists($xmlPath)) { $paramStr = $appsModel->getUserAppParams($id); $params = new JParameter($paramStr, $xmlPath); $paramData = isset($params->_xml['_default']->param) ? $params->_xml['_default']->param : array(); $html = '<form method="POST" action="" name="appSetting" id="appSetting">'; $html .= $params->render(); $html .= '<input type="hidden" value="' . $id . '" name="appid"/>'; $html .= '<input type="hidden" value="' . $appName . '" name="appname"/>'; $html .= '</form>'; $objResponse->addAssign('cWindowContent', 'innerHTML', $html); if (!empty($paramData)) { $objResponse->addScriptCall('cWindowActions', '<input onclick="joms.apps.saveSettings()" type="submit" value="' . JText::_('CC APPLICATION BTN SAVE') . '" class="button" name="Submit"/>'); } $parser =& JFactory::getXMLParser('Simple'); $parser->loadFile($xmlPath); $document =& $parser->document; $element =& $document->getElementByPath('height'); $height = !empty($element) ? $element->data() : 0; if ($height) { $windowHeight = $height; } else { $windowHeight = 100 + $params->getNumParams() * 30; $windowHeight = $windowHeight >= 300 ? 300 : $windowHeight; } } else { $objResponse->addAssign('cWindowContent', 'innerHTML', '<div class-"ajax-notice-apps-configure">' . JText::_('CC APPLICATION AJAX NO CONFIG') . '</div>'); $windowHeight = 100; } $objResponse->addScriptCall('cWindowResize', $windowHeight); $objResponse->addAssign('cwin_logo', 'innerHTML', JText::_('CC APPLICATION SETTINGS TITLE')); return $objResponse->sendResponse(); }
/** * Render a parameter * * @param JParameter $parameter * @param KConfig $config * @return string */ protected function _render($parameter, $config) { return $parameter->render($config->name, $config->group); }
/** * Render * * @access public * @param string The name of the control, or the default text area if a setup file is not found * @param string group * @param bol write out or return * @param int if set and group is repeat only return int row from rendered params * used for form plugin admin pages. * @return string HTML * * NOTE when rendering admin settings I *think* the repeat group is set with $this->_counter_override * @since 1.5 */ function render($name = 'params', $group = '_default', $write = true, $repeatSingleVal = null) { $return = ''; $this->_group = $group; //$$$rob experimental again //problem - when rendering plugin params - e.g. calendar vis - params like the table drop down // are repeated n times. I think the best way to deal with this is to get the data recorded for // the viz and udpate this objects _xml array duplicate the relavent JSimpleXMLElement Objects // for the required number of table drop downs //echo " $name : $group <br>"; $repeat = false; $repeatControls = true; $repeatMin = 0; if (is_array($this->_xml)) { if (array_key_exists($group, $this->_xml)) { $repeat = $this->_xml[$group]->attributes('repeat'); $repeatMin = (int) $this->_xml[$group]->attributes('repeatmin'); $repeatControls = $this->_xml[$group]->attributes('repeatcontrols'); } } if ($repeat) { //get the name of the first element in the group $children = $this->_xml[$group]->children(); if (empty($children)) { $firstElName = ''; $allParamData = ''; $value = ''; } else { $firstElName = str_replace("[]", "", $children[0]->attributes('name')); $allParamData = $this->_registry['_default']['data']; $value = $this->get($firstElName, array(), $group, 'array'); } $c = 0; //limit the number of groups of repeated params written out if (!is_null($repeatSingleVal) && is_int($repeatSingleVal)) { $total = $repeatSingleVal + 1; $start = $repeatSingleVal; } else { $total = count($value); $start = 0; } $identifier = $this->_identifier . '-' . $group; $return .= '<div id="container' . $identifier . '">'; //add in the 'add' button to duplicate the group //only show for first added group if ($repeatControls && $repeatSingleVal == 0) { $return .= "<a href='#' class='addButton'>" . JText::_('ADD') . "</a>"; } for ($x = $start; $x < $total; $x++) { //call render for the number of time the group is repeated //echo parent::render($name, $group); $return .= '<div class="repeatGroup" id="' . $identifier . 'group-' . $x . '">'; ////new //$this->_counter_override = $x; $params =& $this->getParams($name, $group, 'array', $x); $html = array(); $html[] = '<table width="100%" class="paramlist admintable" cellspacing="1">'; if ($description = $this->_xml[$group]->attributes('description')) { // add the params description to the display $desc = JText::_($description); $html[] = '<tr><td class="paramlist_description" colspan="2">' . $desc . '</td></tr>'; } foreach ($params as $param) { $html[] = '<tr>'; if ($param[0]) { $html[] = '<td width="40%" class="paramlist_key"><span class="editlinktip">' . $param[0] . '</span></td>'; $html[] = '<td class="paramlist_value">' . $param[1] . '</td>'; } else { $html[] = '<td class="paramlist_value" colspan="2">' . $param[1] . '</td>'; } $html[] = '</tr>'; } if (count($params) < 1) { $html[] = "<tr><td colspan=\"2\"><i>" . JText::_('THERE ARE NO PARAMETERS FOR THIS ITEM') . "</i></td></tr>"; } $html[] = '</table>'; if ($repeatControls) { $html[] = "<a href='#' class=\"removeButton delete\">" . JText::_('DELETE') . "</a>"; } $return .= implode("\n", $html); ///end new $c++; $return .= "</div>"; } $return .= "</div>"; } else { $return .= parent::render($name, $group); } if ($repeat && $repeatControls && ($repeatSingleVal == null || $repeatSingleVal == 0)) { FabrikHelperHTML::script('params.js', 'components/com_fabrik/libs/'); // watch add and remove buttons $document =& JFactory::getDocument(); $script = "window.addEvent('domready', function() {\n\t\t\t new RepeatParams('container{$identifier}', {repeatMin:{$repeatMin}});\n\t});"; FabrikHelperHTML::addScriptDeclaration($script); } if ($write) { echo $return; } else { return $return; } }
function showConfig(&$row, &$lists) { global $mainframe; // Load tooltips behavior JHTML::_('behavior.tooltip'); JHTML::_('behavior.switcher'); // Load component specific configurations $table =& JTable::getInstance('component'); $table->loadByOption('com_users'); $userparams = new JParameter($table->params, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'config.xml'); $table->loadByOption('com_media'); $mediaparams = new JParameter($table->params, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_media' . DS . 'config.xml'); // Build the component's submenu $contents = ''; $tmplpath = dirname(__FILE__) . DS . 'tmpl'; ob_start(); require_once $tmplpath . DS . 'navigation.php'; $contents = ob_get_contents(); ob_end_clean(); // Set document data $document =& JFactory::getDocument(); $document->setBuffer($contents, 'modules', 'submenu'); // Load settings for the FTP layer jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); ?> <form action="index.php" method="post" name="adminForm" autocomplete="off"> <?php if ($ftp) { require_once $tmplpath . DS . 'ftp.php'; } ?> <div id="config-document"> <div id="page-site"> <table class="noshow"> <tr> <td width="65%"> <?php require_once $tmplpath . DS . 'config_site.php'; ?> <?php require_once $tmplpath . DS . 'config_metadata.php'; ?> </td> <td width="35%"> <?php require_once $tmplpath . DS . 'config_seo.php'; ?> </td> </tr> </table> </div> <div id="page-system"> <table class="noshow"> <tr> <td width="60%"> <?php require_once $tmplpath . DS . 'config_system.php'; ?> <fieldset class="adminform"> <legend><?php echo JText::_('User Settings'); ?> </legend> <?php echo $userparams->render('userparams'); ?> </fieldset> <fieldset class="adminform"> <legend><?php echo JText::_('Media Settings'); ?> <span class="error hasTip" title="<?php echo JText::_('Warning'); ?> ::<?php echo JText::_('WARNPATHCHANGES'); ?> "> <?php echo ConfigApplicationView::WarningIcon(); ?> </span> </legend> <?php echo $mediaparams->render('mediaparams'); ?> </fieldset> </td> <td width="40%"> <?php require_once $tmplpath . DS . 'config_debug.php'; ?> <?php require_once $tmplpath . DS . 'config_cache.php'; ?> <?php require_once $tmplpath . DS . 'config_session.php'; ?> </td> </tr> </table> </div> <div id="page-server"> <table class="noshow"> <tr> <td width="60%"> <?php require_once $tmplpath . DS . 'config_server.php'; ?> <?php require_once $tmplpath . DS . 'config_locale.php'; ?> <?php require_once $tmplpath . DS . 'config_ftp.php'; ?> </td> <td width="40%"> <?php require_once $tmplpath . DS . 'config_database.php'; ?> <?php require_once $tmplpath . DS . 'config_mail.php'; ?> </td> </tr> </table> </div> <div id="page-permissions"> <table class="noshow"> <tr> <td width="100%"> <?php require_once $tmplpath . DS . 'config_permissions.php'; ?> </td> </tr> </table> </div> </div> <div class="clr"></div> <input type="hidden" name="c" value="global" /> <input type="hidden" name="live_site" value="<?php echo isset($row->live_site) ? $row->live_site : ''; ?> " /> <input type="hidden" name="option" value="com_config" /> <input type="hidden" name="secret" value="<?php echo $row->secret; ?> " /> <input type="hidden" name="task" value="" /> <?php echo JHTML::_('form.token'); ?> </form> <?php }
$module = JModuleHelper::getModule($prName); $basePath = JPATH_ROOT . DS . 'modules' . DS . $this->selectedProject; $xmlfile = $basePath . DS . $this->selectedProject . '.xml'; $parameter = new JParameter($module->params, $xmlfile); ?> <table width="100%"> <tr valign="top"> <td> <?php easyHTML::projectSelector(); ?> </td> <td> <div style="border: 1px solid red; padding: 5px;"> <?php echo JModuleHelper::renderModule($module); ?> </div> <h2><?php echo JText::_('Parameters'); ?> </h2> <?php echo $parameter->render(); ?> </td> </tr> </table>
<tr/> </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::_('Doctors Parameters'), "param-page"); echo $params->render(); echo $pane->endPanel(); echo $pane->startPanel(JText::_('Advanced Parameters'), "param-page"); echo $params->render('params', 'advanced'); echo $pane->endPanel(); echo $pane->startPanel(JText::_('E-mail Parameters'), "param-page"); echo $params->render('params', 'email'); echo $pane->endPanel(); echo $pane->endPane(); ?> </fieldset> </div> <div class="col width-70"> <fieldset class="adminform"> <legend><?php
/** * Read custom params from XML file and render them **/ function _buildFieldParams($type, $params = '') { $xmlPath = JPATH_ROOT . DS . 'components' . DS . 'com_community' . DS . 'libraries' . DS . 'fields' . DS . $type . '.xml'; $html = ''; if (JFile::exists($xmlPath)) { $params = new JParameter($params, $xmlPath); $html = $params->render(); } return $html; }
/** * 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 showPluginSettings(&$extension, $itemid = '-1') { // get params definitions $xmlfile = $extension->getXmlPath(); $params = new JParameter($extension->getParams($itemid, true), $xmlfile, 'xmap_ext'); ?> <form name="frmSettings" id="frmSettings<?php echo $extension->id; ?> "> <input type="hidden" name="id" value="<?php echo $extension->id; ?> " /> <?php echo $params->render(); ?> <div style="text-align: center;padding: 5px;"> <input type="button" name="cancel" onclick="closeSettings('pluginsettings');" value="<?php echo _XMAP_TOOLBAR_CANCEL; ?> " /> <input type="button" name="save" onclick="saveSettings(<?php echo $extension->id; ?> ,'save_plugin_settings','pluginsettings');" value="<?php echo _XMAP_TOOLBAR_SAVE; ?> " /> </div> </form> <?php }
function changeTheme() { $theme = JRequest::getCmd('theme'); $template = JRequest::getCmd('template'); $html = ''; $result['theme'] = $theme; $result['type'] = 'change'; $result['successful'] = ''; if ($theme) { $xml_theme = JPATH_SITE . DS . 'templates' . DS . $template . DS . 'html' . DS . 'mod_janewspro' . DS . $theme . DS . 'params.xml'; if (!JFile::exists($xml_theme) || !$template) { $xml_theme = JPATH_SITE . DS . 'modules' . DS . 'mod_janewspro' . DS . 'tmpl' . DS . $theme . DS . 'params.xml'; } if (JFile::exists($xml_theme)) { $paramsForm = new JParameter('', $xml_theme, 'template'); $html = $paramsForm->render('japarams'); } } $result['html'] = $html; echo json_encode($result); exit; }
function getPropertiesForm() { $pManager =& getPluginManager(); $pManager->loadPlugins('acl'); $pManager->loadPlugins('field'); $pManager->loadPlugins('hook'); $pManager->loadPlugins('validation'); $pane =& JPane::getInstance('sliders'); $output = JHTML::_('jwf.indentedLine', '<div id="properties-container">', 2); $output .= JHTML::_('jwf.indentedLine', "<fieldset><legend>" . JText::_('Identification') . "</legend>", 2); $output .= JHTML::_('jwf.indentedLine', "<label for='properties_input_title'>" . JText::_('Title') . "</label>", 2); $output .= JHTML::_('jwf.indentedLine', "<input onchange='saveElement()' type='text' id='properties_input_title' />", 2); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<label for='properties_input_task'>" . JText::_('Task') . "</label>", 2); $output .= JHTML::_('jwf.indentedLine', "<textarea onchange='saveElement()' id='properties_input_task'></textarea>", 2); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<label id='properties_lbl_acl' for='properties_input_acl'>" . JText::_('Group') . "</label>", 2); $output .= JHTML::_('select.genericlist', array(), "properties_input_acl", 'onchange="saveElement()" class="inputbox" size="1"', 'value', 'text', '', 'properties_input_acl'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<input onclick='deleteSelectedElement()' id='properties_input_delete' type='button' value='" . JText::_('Delete Station') . "' />", 2); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "</fieldset>", 2); $output .= JHTML::_('jwf.indentedLine', "<fieldset><legend>" . JText::_('Allocated Time') . "</legend>", 2); $output .= JHTML::_('jwf.indentedLine', "<label style='width:40px;' id='properties_lbl_hours' for='properties_input_hours'>" . JText::_('Hours') . "</label>", 2); $output .= JHTML::_('select.integerlist', 0, 23, 1, "properties_input_hours", 'id="properties_input_hours" style="width:40px;" onchange="saveElement()" class="inputbox" size="1"'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<label style='width:40px;' id='properties_lbl_days' for='properties_input_days'>" . JText::_('Days') . "</label>", 2); $output .= JHTML::_('select.integerlist', 0, 30, 1, "properties_input_days", 'id="properties_input_days" style="width:40px;" onchange="saveElement()" class="inputbox" size="1"'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<label style='width:40px;' id='properties_lbl_months' for='properties_input_months'>" . JText::_('Months') . "</label>", 2); $output .= JHTML::_('select.integerlist', 0, 11, 1, "properties_input_months", 'id="properties_input_months" style="width:40px;" onchange="saveElement()" class="inputbox" size="1"'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "</fieldset>", 2); $fieldList = array(); $output .= JHTML::_('jwf.indentedLine', "<label id='properties_lbl_fields' for='properties_input_fields'>" . JText::_('Active fields') . "</label>", 2); foreach ($pManager->settings['field'] as $p) { $fieldList[] = JHTML::_('select.option', $p->id, JText::_($p->name)); } $output .= JHTML::_('select.genericlist', $fieldList, "properties_input_fields", 'multiple="multiple" class="inputbox field" size="5"', 'value', 'text'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $validationList = array(); $output .= JHTML::_('jwf.indentedLine', "<label id='properties_lbl_validations' for='properties_input_validations'>" . JText::_('Active validations') . "</label>", 2); foreach ($pManager->settings['validation'] as $p) { $validationList[] = JHTML::_('select.option', $p->id, JText::_($p->name)); } $output .= JHTML::_('select.genericlist', $validationList, "properties_input_validations", 'multiple="multiple" class="inputbox validation" size="5"', 'value', 'text'); $output .= JHTML::_('jwf.indentedLine', "<div class='clear'></div>", 2); $output .= JHTML::_('jwf.indentedLine', "<h2>" . JText::_('Active hooks') . "</h2>", 2); $output .= JHTML::_('jwf.indentedLine', "<form id='hook-settings-form'>", 2); $hookList = array(); $paneOutput = JHTML::_('jwf.hiddenPane'); $paneOutput .= $pane->startPane('hooks-pane'); foreach ($pManager->settings['hook'] as $p) { $form = new JParameter('', $p->xml); $params = $form->renderToArray(); $paneOutput .= JHTML::_('jwf.startJSBlock', 2); $paneOutput .= JHTML::_('jwf.indentedLine', 'hookParameters["' . $p->id . '"] = new Array();', 3); $i = 0; foreach ($params as $key => $value) { $paneOutput .= JHTML::_('jwf.indentedLine', 'hookParameters["' . $p->id . '"][' . $i . '] = "' . $key . '"', 3); $i++; } $paneOutput .= JHTML::_('jwf.endJSBlock', 2); $title = JText::_($p->name . ' ' . JText::_('Settings')); $paneOutput .= '<div class="search-pane-list-handle"></div>'; $paneOutput .= '<div class="search-pane-list-check"><input value="' . $p->id . '" type="checkbox" class="active-hooks" name="properties_input_hooks[' . $p->id . ']" checked="checked" id="properties_input_hook_' . $p->id . '" /></div>'; $paneOutput .= $pane->startPanel($title, "form-page"); $paneOutput .= $form->render('hooks-' . $p->id); $paneOutput .= $pane->endPanel(); } $paneOutput .= $pane->endPane(); $paneOutput .= JHTML::_('jwf.indentedLine', "</form>", 2); $output .= $paneOutput; $output .= JHTML::_('jwf.indentedLine', '</div>', 2); return $output; }
* @category Nooku * @package Nooku_Server * @subpackage Settings * @copyright Copyright (C) 2011 Timble CVBA and Contributors. (http://www.timble.net). * @license GNU GPLv3 <http://www.gnu.org/licenses/gpl.html> * @link http://www.nooku.org */ defined('KOOWA') or die('Restricted access'); ?> <?php echo @helper('tabs.startPanel', array('id' => $settings->getName(), 'title' => @text(ucfirst($settings->getName())))); ?> <h2><?php echo @text(ucfirst($settings->getName())); ?> </h2> <section> <h3><?php echo @text(ucfirst($settings->getName())); ?> </h3> <? $params = new JParameter( null, $settings->getPath() ); $params->loadArray($settings->toArray()); echo $params->render('settings['.$settings->getName().']'); ?> </section> <?php echo @helper('tabs.endPanel');
</select> </p> <?php if ($plugins = Event::trigger('courses.onAssetgroupEdit')) { $data = $ag->get('params'); foreach ($plugins as $plugin) { $p = Plugin::byType('courses', $plugin['name']); $default = new \Hubzero\Config\Registry($p->params); $param = new JParameter(is_object($data) ? $data->toString() : $data, PATH_CORE . DS . 'plugins' . DS . 'courses' . DS . $plugin['name'] . DS . $plugin['name'] . '.xml'); foreach ($default->toArray() as $k => $v) { if (substr($k, 0, strlen('default_')) == 'default_') { $param->def(substr($k, strlen('default_')), $default->get($k, $v)); } } $out = $param->render('params', 'onAssetgroupEdit'); if (!$out) { continue; } ?> <fieldset class="eventparams" id="params-<?php echo $plugin['name']; ?> "> <legend><?php echo Lang::txt('%s Parameters', $plugin['title']); ?> </legend> <?php echo $out; ?>
/** * Logic to render an XML file as form parameters * NOTE: this does not work with Request Data validation in J2.5+. The validation * must be skipped or the parameters must be re-added after the validation * * @access public * @return void * @since 1.5 */ function getlayoutparams() { jimport('joomla.filesystem.file'); $mainframe = JFactory::getApplication(); $user = JFactory::getUser(); //get vars $ext_view = JRequest::getVar('ext_view', ''); $ext_id = JRequest::getInt('ext_id', 0); $layout_name = JRequest::getVar('layout_name', 0); $directory = JRequest::getVar('directory', 0); $path = (!is_dir($directory) ? JPATH_ROOT : '') . $directory; $db = JFactory::getDBO(); if ($ext_view == 'module') { $query = 'SELECT params FROM #__modules WHERE id = ' . $ext_id; } else { if ($ext_view == 'field') { $query = 'SELECT attribs FROM #__flexicontent_fields WHERE id = ' . $ext_id; } else { echo "not supported extension/view: " . $ext_view; return; } } $db->setQuery($query); $ext_params_str = $db->loadResult(); $layoutpath = $path . DS . $layout_name . '.xml'; if (!file_exists($layoutpath)) { echo !FLEXI_J16GE ? '<div style="font-size: 11px; color: gray; background-color: lightyellow; border: 1px solid lightgray; width: auto; padding: 4px 2%; margin: 1px 8px; height: auto;">' : '<p class="tip">'; echo ' Currently selected layout: <b>"' . $layout_name . '"</b> does not have layout specific parameters'; echo !FLEXI_J16GE ? '</div>' : '</p>'; exit; } //Get data from the model if (FLEXI_J16GE) { $grpname = 'params'; // this name of <fields> container if (FLEXI_J30GE) { $xml = simplexml_load_file($layoutpath); $xmldoc =& $xml; } else { $xml = JFactory::getXMLParser('Simple'); $xml->loadFile($layoutpath); $xmldoc =& $xml->document; } $tmpl_params = FLEXI_J30GE ? $xmldoc->asXML() : $xmldoc->toString(); // Create form object, (form name seems not to cause any problem) $jform = new JForm('com_flexicontent.template.item', array('control' => 'jform', 'load_data' => true)); $jform->load($tmpl_params); // Load existing layout values into the object (that we got from DB) $ext_params = new JRegistry($ext_params_str); // and for J1.5: new JParameter($ext_params_str); foreach ($jform->getGroup($grpname) as $field) { $fieldname = $field->__get('fieldname'); $value = $ext_params->get($fieldname); if (strlen($value)) { $jform->setValue($fieldname, $grpname, $value); } } } else { // Create a parameters object $form = new JParameter('', $layoutpath); // Load existing layout values into the object (that we got from DB) $form->loadINI($ext_params_str); } if ($layout_name) { if (!FLEXI_J16GE) { echo $form->render('params', 'layout'); } else { ?> <fieldset class="panelform"><ul class="adminformlist"> <?php foreach ($jform->getGroup($grpname) as $field) { echo '<li>' . $field->label . $field->input . '</li>'; } ?> </ul></fieldset> <?php } } else { echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_('FLEXI_APPLY_TO_SEE_THE_PARAMETERS') . "</span><br /><br />"; } //parent::display($tpl); }
$strings = array(); $tips = array(); foreach ($groups as $group => $count) { if ($group != "_default" && $count > 0) { echo $tabs->startPanel(JText::_($group), 'config_' . str_replace(" ", "_", $group)); echo $this->params->render('params', $group); echo $tabs->endPanel(); } } // Now get layout specific parameters foreach (JEV_CommonFunctions::getJEventsViewList() as $viewfile) { $config = JPATH_SITE . "/components/" . JEV_COM_COMPONENT . "/views/" . $viewfile . "/config.xml"; if (file_exists($config)) { $viewparams = new JParameter($this->params->toString(), $config); echo $tabs->startPanel(JText::_(ucfirst($viewfile)), 'config_' . str_replace(" ", "_", $viewfile)); echo $viewparams->render(); echo $tabs->endPanel(); } } echo $tabs->endPane(); } else { echo $this->params->render(); } ?> <div class="clr"></div> </fieldset> <input type="hidden" name="id" value="<?php echo $this->component->id;
/** * Logic to render an XML file as form parameters * NOTE: this does not work with Request Data validation in J2.5+. The validation * must be skipped or the parameters must be re-added after the validation * * @access public * @return void * @since 1.5 */ function getlayoutparams() { jimport('joomla.filesystem.file'); $app = JFactory::getApplication(); $user = JFactory::getUser(); //get vars $ext_option = JRequest::getVar('ext_option', ''); $ext_view = JRequest::getVar('ext_view', ''); $ext_id = JRequest::getInt('ext_id', 0); $layout_name = JRequest::getVar('layout_name', 0); $directory = JRequest::getVar('directory', 0); $path = (!is_dir($directory) ? JPATH_ROOT : '') . $directory; $db = JFactory::getDBO(); if ($ext_view == 'module') { $query = 'SELECT params FROM #__modules WHERE id = ' . $ext_id; // load english language file for 'mod_flexicontent' module then override with current language file $module_name = basename(dirname($directory)); JFactory::getLanguage()->load($module_name, JPATH_SITE, 'en-GB', true); JFactory::getLanguage()->load($module_name, JPATH_SITE, null, true); } else { if ($ext_view == 'field') { $query = 'SELECT attribs FROM #__flexicontent_fields WHERE id = ' . $ext_id; } else { echo "not supported extension/view: " . $ext_view; return; } } if ($ext_option != 'com_flexicontent' && $ext_option != 'com_modules' && $ext_option != 'com_advancedmodules' && $ext_option != 'com_menus') { echo '<div class="alert fcpadded fcinlineblock" style="">You are editing module via extension: <span class="label label-warning">' . $ext_option . '</span><br/> - If extension does not call Joomla event <span class="label label-warning">onExtensionBeforeSave</span> then custom layout parameters may not be saved</div>'; } $db->setQuery($query); $ext_params_str = $db->loadResult(); $layout_names = explode(':', $layout_name); if (count($layout_names) > 1) { $layout_name = $layout_names[1]; $layoutpath = JPATH_ROOT . DS . 'templates' . DS . $layout_names[0] . DS . 'html' . DS . 'mod_flexicontent/' . $layout_name . '.xml'; } else { $layoutpath = $path . DS . $layout_name . '.xml'; } if (!file_exists($layoutpath)) { if (file_exists($path . DS . '_fallback' . DS . '_fallback.xml')) { $layoutpath = $path . DS . '_fallback' . DS . '_fallback.xml'; echo '<div class="alert fcpadded fcinlineblock">Currently selected layout: <b>"' . $layout_name . '"</b> does not have a parameters XML file, using general defaults. if this is an old template then these parameters will allow to continue using it, but we recommend that you create parameter file: ' . $layout_name . '.xml</div><div class="clear"></div>'; } else { echo !FLEXI_J16GE ? '<div style="font-size: 11px; color: gray; background-color: lightyellow; border: 1px solid lightgray; width: auto; padding: 4px 2%; margin: 1px 8px; height: auto;">' : '<p class="tip">'; echo ' Currently selected layout: <b>"' . $layout_name . '"</b> does not have layout specific parameters'; echo !FLEXI_J16GE ? '</div>' : '</p>'; exit; } } //Get data from the model if (FLEXI_J16GE) { // Load XML file if (FLEXI_J30GE) { $xml = simplexml_load_file($layoutpath); $xmldoc =& $xml; } else { $xml = JFactory::getXMLParser('Simple'); $xml->loadFile($layoutpath); $xmldoc =& $xml->document; } // Create form object, (form name seems not to cause any problem) $jform = new JForm('com_flexicontent.template.item', array('control' => 'jform', 'load_data' => true)); $tmpl_params = FLEXI_J30GE ? $xmldoc->asXML() : $xmldoc->toString(); $jform->load($tmpl_params); // Load existing layout values into the object (that we got from DB) $ext_params = new JRegistry($ext_params_str); // and for J1.5: new JParameter($ext_params_str); $grpname = 'params'; // this is the name of <fields> container foreach ($jform->getGroup($grpname) as $field) { $fieldname = $field->__get('fieldname'); $value = $ext_params->get($fieldname); if (strlen($value)) { $jform->setValue($fieldname, $grpname, $value); } } } else { // Create a parameters object $form = new JParameter('', $layoutpath); // Load existing layout values into the object (that we got from DB) $form->loadINI($ext_params_str); } if ($layout_name) { if (!FLEXI_J16GE) { echo $form->render('params', 'layout'); } else { ?> <fieldset class="panelform"><ul class="adminformlist"> <?php $grpname = 'params'; // this is the name of <fields> container foreach ($jform->getGroup($grpname) as $field) { echo '<li>' . $field->label . $field->input . '</li>'; } ?> </ul></fieldset> <?php } } else { echo "<br /><span style=\"padding-left:25px;\"'>" . JText::_('FLEXI_APPLY_TO_SEE_THE_PARAMETERS') . "</span><br /><br />"; } //parent::display($tpl); }
} if (JFolder::exists($path . DS . 'extensions')) { $db =& JFactory::getDBO(); $query = 'SELECT *' . ' FROM #__jce_extensions' . ' WHERE published = 1' . ' AND pid = ' . (int) $plugin->id; $db->setQuery($query); $extensions = $db->loadObjectList(); foreach ($extensions as $extension) { // Load extension xml file $file = $path . DS . 'extensions' . DS . $extension->folder . DS . $extension->extension . '.xml'; // Load extension language file $lang =& JFactory::getLanguage(); $lang->load('com_jce_' . trim($name) . '_' . trim($extension->extension), JPATH_SITE); if (JFile::exists($file)) { $params = new JParameter($this->group->params, $file); if ($params->getNumParams()) { if ($output = $params->render('params')) { echo $pane->startPanel(JText::_($extension->name), $extension->extension . "-extension-page"); echo $output; echo $pane->endPanel(); } } } } } echo $pane->endPane(); ?> </fieldset> </div> <?php } else { echo JText::_('NO PLUGINS IN LAYOUT');
public static function showConfig(&$row, &$lists) { global $mainframe; // Load component specific configurations $table =& JTable::getInstance('component'); $table->loadByOption('com_users'); $userparams = new JParameter($table->params, JPATH_ADMINISTRATOR . DS . 'components' . DS . 'com_users' . DS . 'config.xml'); // Build the component's submenu $contents = ''; $tmplpath = dirname(__FILE__) . DS . 'tmpl'; ob_start(); require_once $tmplpath . DS . 'navigation.php'; $contents = ob_get_contents(); ob_end_clean(); // Load settings for the FTP layer jimport('joomla.client.helper'); $ftp =& JClientHelper::setCredentialsFromRequest('ftp'); ?> <form action="index.php" method="post" name="adminForm" autocomplete="off"> <?php if ($ftp) { require_once $tmplpath . DS . 'ftp.php'; } ?> <div id="config-document"> <div id="page-site"> <table class="noshow"> <tr> <td width="66%"> <?php require_once $tmplpath . DS . 'config_site.php'; ?> </td> <td width="36%"> <?php require_once $tmplpath . DS . 'config_seo.php'; ?> </td> </tr> </table> </div> <div id="page-system"> <table class="noshow"> <tr> <td width="66%"> <?php require_once $tmplpath . DS . 'config_system.php'; ?> <fieldset class="adminform"> <legend><?php echo JText::_('User Settings'); ?> </legend> <?php echo $userparams->render('userparams'); ?> </fieldset> </td> <td width="33%"> <?php require_once $tmplpath . DS . 'config_debug.php'; ?> <?php require_once $tmplpath . DS . 'config_cache.php'; ?> <?php require_once $tmplpath . DS . 'config_session.php'; ?> </td> </tr> </table> </div> <div id="page-server"> <table class="noshow"> <tr> <td width="65%"> <?php require_once $tmplpath . DS . 'config_server.php'; ?> <?php require_once $tmplpath . DS . 'config_locale.php'; ?> </td> <td width="35%"> <?php require_once $tmplpath . DS . 'config_database.php'; ?> <?php require_once $tmplpath . DS . 'config_mail.php'; ?> </td> </tr> </table> </div> </div> <div class="clr"></div> <input type="hidden" name="c" value="global" /> <input type="hidden" name="live_site" value="<?php echo isset($row->live_site) ? $row->live_site : ''; ?> " /> <input type="hidden" name="option" value="com_config" /> <input type="hidden" name="secret" value="<?php echo $row->secret; ?> " /> <input type="hidden" name="task" value="" /> <?php echo JHTML::_('form.token'); ?> </form> <?php }
<p> </p> <hr /> <h2><input type="CHECKBOX" id="AG_form_insertParams" name="AG_form_insertParams" /> <?php echo JText::_("AG_PARAMETERS"); ?> </h2> <div id="AG_form_params" style="display:none;"> <?php $db =& JFactory::getDBO(); $query = "SELECT * FROM #__plugins"; $db->setQuery($query); $row = $db->loadAssocList('name'); $paramsdata = $row['Content - AdmirorGallery']['params']; $paramsdefs = JPATH_COMPONENT_ADMINISTRATOR . DS . 'views' . DS . 'button' . DS . 'tmpl' . DS . 'default.xml'; $myparams = new JParameter($paramsdata, $paramsdefs); echo $myparams->render('params'); ?> </div> <script type="text/javascript"> AG_jQuery(document).ready(function() { AG_jQuery(".ag_button_folderName").click(function(event) { event.preventDefault(); }); AG_jQuery('#AG_form_insertParams').change(function() { if(AG_jQuery('#AG_form_insertParams').attr('checked')){ AG_jQuery('#AG_form_params').fadeIn("slow"); }else{ AG_jQuery('#AG_form_params').fadeOut("slow"); }
/** * Start Plugin class * @param plugin * @param template * @param config **/ function JYAMLplugin($plugin, $template, $config = false) { $this->plugin = $plugin; // core array $core_plugins = array('ie_png_fix', 'css_optimizer', 'ie_min_max_expressions'); $this->configfile = JPATH_SITE . DS . 'templates' . DS . $template . DS . 'plugins' . DS . $plugin . DS . 'config.xml'; if (JFile::exists($this->configfile)) { // Load language File $lang =& JFactory::getLanguage(); $lang->load('pgl_template', JPATH_SITE . DS . 'templates' . DS . $template . DS . 'plugins' . DS . $plugin); $this->paramString = isset($config[$plugin]['paramString']) ? $config[$plugin]['paramString'] : false; if (!$this->paramString) { $this->paramString = JFile::read($this->configfile); } $this->xmlfile = JPATH_SITE . DS . 'templates' . DS . $template . DS . 'plugins' . DS . $plugin . DS . $plugin . '.xml'; $xmldoc =& JFactory::getXMLParser('Simple'); if (JFile::exists($this->xmlfile)) { $xmldoc->loadfile($this->xmlfile); $config_name = $xmldoc->document->name[0]->data(); $this->name = $config_name; $config_version = $xmldoc->document->version[0]->data(); $this->version = $config_version; $config_description = $xmldoc->document->description[0]->data(); $this->description = JText::_($config_description); $params = new JParameter($this->paramString, $this->xmlfile); //$params->addElementPath( JPATH_SITE.DS.'templates'.DS.$template.DS.'plugins'.DS.$plugin.DS.'element' ); $this->paramOutput = $params->render("plugins[{$plugin}]"); $this->published = $params->get('published', 0); // Check is Core if (!in_array($this->plugin, $core_plugins)) { $this->isCore = 0; } } unset($xmldoc); } }