function getMessage($extension = '', $xml = '', $version = '', $addmargin = 0) { if (!$extension || !$xml && !$version) { return; } $alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension))); if ($xml) { $xml = JApplicationHelper::parseXMLInstallFile(JPATH_SITE . DS . str_replace('/', DS, $xml)); if ($xml && isset($xml['version'])) { $version = $xml['version']; } } if (!$version) { return; } 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $url = 'http://www.nonumber.nl/scripts/version.php?ext=' . $alias . '&version=' . $version; $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayVersion( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $msg = JText::sprintf('NN_A_NEWER_VERSION_IS_AVAILABLE', 'http://www.nonumber.nl/' . $alias . '/download', '<span id="nonumber_newversionnumber_' . $alias . '"></span>', $version); $margin = $addmargin ? '10px;' : '3px;'; $msg = '<div style="border:3px solid #F0DC7E;color:#CC0000;margin-bottom:' . $margin . '"><div style="padding: 2px 5px;background-color:#EFE7B8">' . $msg . '</div></div>'; $msg = '<div id="nonumber_version_' . $alias . '" style="display: none;">' . $msg . '</div>'; return $msg; }
public static function getInstance() { if (!self::$instance) { self::$instance = new NNFrameworkFunctions(); } return self::$instance; }
function fetchElement($name, $value, &$node, $control_name) { 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $label = $this->def($node->attributes('label'), 'the main extension'); $file = $node->attributes('file'); $file = str_replace('/', DS, $file); $this->setMessage($file, $label); $random = rand(100000, 999999); $html = '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; return $html; }
function fetchElement($name, $value, &$node) { 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $extension = $node->attributes('extension'); $admin = $this->def($node->attributes('admin'), 1); $path = $admin ? JPATH_ADMINISTRATOR : JPATH_SITE; // load the admin language file $lang =& JFactory::getLanguage(); $lang->load($extension, $path, 'en-GB'); // Loads English language file as fallback (for undefined stuff in other language file) $lang->load($extension, $path, null, 1); $random = rand(100000, 999999); $html = '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; return $html; }
function fetchElement($name, $value, &$node, $control_name) { $size = $node->attributes('size') ? 'size="' . $node->attributes('size') . '"' : ''; $class = $node->attributes('class') ? 'class="' . $node->attributes('class') . '"' : 'class="text_area"'; $value = htmlspecialchars(html_entity_decode($value, ENT_QUOTES), ENT_QUOTES); 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $val_name = $control_name . str_replace('_key', '_value', $name); $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tif ( \$( 'span_" . $val_name . "' ) ) {\n\t\t\t\t\t\$( 'span_" . $control_name . $name . "' ).injectInside( \$( 'span_" . $val_name . "' ) );\n\t\t\t\t}\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $html = '<input type="text" name="' . $control_name . '[' . $name . ']" id="' . $control_name . $name . '" value="' . $value . '" ' . $class . ' ' . $size . ' />'; $html .= '<span id="span_' . $control_name . $name . '">' . $html . '</span>'; $random = rand(100000, 999999); $html .= '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; return $html; }
function fetchElement($name, $value, &$node, $control_name) { 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $file = $node->attributes('file'); if (!$file) { $path = $node->attributes('path') == 'site' ? '' : DS . 'administrator'; $label = $node->attributes('label'); $file = $this->def($node->attributes('alias'), $node->attributes('label')); $file = preg_replace('#[^a-z-]#', '', strtolower($file)); $extension = $node->attributes('extension'); switch ($extension) { case 'com': $file = $path . DS . 'components' . DS . 'com_' . $file . DS . 'com_' . $file . '.xml'; break; case 'mod': $file = $path . DS . 'modules' . DS . 'mod_' . $file . DS . 'mod_' . $file . '.xml'; break; case 'plg_editors-xtd': $file = DS . 'plugins' . DS . 'editors-xtd' . DS . $file . '.xml'; break; default: $file = DS . 'plugins' . DS . 'system' . DS . $file . '.xml'; break; } $label = JText::_($label) . ' (' . JText::_('NN_' . strtoupper($extension)) . ')'; } else { $label = $this->def($node->attributes('label'), 'the main extension'); $file = str_replace('/', DS, $file); } $this->setMessage($file, $label); $random = rand(100000, 999999); $html = '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; return $html; }
function fetchElement($name, $value, &$node, $control_name) { $resize = $node->attributes('resize'); $width = $this->def($node->attributes('width'), 400); $minwidth = $this->def($node->attributes('minwidth'), 200); $minwidth = min($width, $minwidth); $maxwidth = $this->def($node->attributes('maxwidth'), 1200); $maxwidth = max($width, $maxwidth); $height = $this->def($node->attributes('height'), 80); $minheight = $this->def($node->attributes('minheight'), 40); $minheight = min($height, $minheight); $maxheight = $this->def($node->attributes('maxheight'), 600); $maxheight = max($height, $maxheight); $class = $this->def($node->attributes('class'), 'text_area'); $class = 'class="' . $class . '"'; $type = $node->attributes('texttype'); if ($resize) { 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) . '/plugins/system/nonumberelements/elements/textareaplus/textareaplus' . $mt_version . '.js'); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/elements/textareaplus/textareaplus.css'); // not for Safari (and other webkit browsers) because it has its own resize option $script = 'window.addEvent( \'domready\', function() {' . ' if ( !window.webkit ) {' . ' new TextAreaResizer( \'' . $control_name . $name . '\', { \'min_x\':' . $minwidth . ', \'max_x\':' . $maxwidth . ', \'min_y\':' . $minheight . ', \'max_y\':' . $maxheight . ' } );' . " }" . " });"; $document->addScriptDeclaration($script); } if ($type == 'html') { // Convert <br /> tags so they are not visible when editing $value = str_replace('<br />', "\n", $value); } else { if ($type == 'regex') { // Protects the special characters $value = str_replace('[:REGEX_ENTER:]', '\\n', $value); } } return '<textarea name="' . $control_name . '[' . $name . ']" cols="' . round($width / 7.5) . '" rows="' . round($height / 15) . '" style="width:' . $width . 'px;height:' . $height . 'px" ' . $class . ' id="' . $control_name . $name . '" >' . $value . '</textarea>'; }
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>'; }
function getMessage($extension = '', $addmargin = 0) { if (!$extension) { return; } $alias = preg_replace('#[^a-z\\-]#', '', str_replace('?', '-', strtolower($extension))); $host = parse_url(JURI::root(false)); $host = strtolower($host['host']); if (!$host || $host == 'localhost' || $host == '127.0.0.1') { return $this->blockHTML($extension, $alias, 'local', '', $addmargin); } $db =& JFactory::getDBO(); $sql = 'show tables like "' . $db->getPrefix() . 'nonumber_licenses"'; $db->setQuery($sql); $exists = $db->loadResult(); $code = ''; if ($exists) { $sql = 'SELECT code FROM #__nonumber_licenses' . ' WHERE extension = \'all\'' . ' LIMIT 1'; $db->setQuery($sql); $code = $db->loadResult(); if (!$code) { $sql = 'SELECT code FROM #__nonumber_licenses' . ' WHERE extension = \'' . $alias . '\'' . ' LIMIT 1'; $db->setQuery($sql); $code = $db->loadResult(); } } if (!(strpos($host, '.') === false)) { $host_array = explode('.', $host); if (count($host_array) > 1) { $slds = 'ac au city co com edu gov gv law ltd me med mil mod net nhs nic nom org parliament plc police pub sch school'; $host = array(); $host[] = array_pop($host_array); $host[] = array_pop($host_array); if (in_array($host['1'], explode(' ', $slds))) { $host[] = array_pop($host_array); } $host = implode('.', array_reverse($host)); } } if (!$code) { return $this->blockHTML($extension, $alias, 'none', $host, $addmargin); } 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); // url to the license checker on the nonumber.nl server // returns the state (valid, invalid, fail) $url = 'http://www.nonumber.nl/scripts/license.php?host=' . $host . '&code=' . $code . '&ext=' . $alias; $script = "\n\t\t\twindow.addEvent( 'domready', function() {\n\t\t\t\tnnScripts.loadajax(\n\t\t\t\t\t'" . $url . "',\n\t\t\t\t\t'nnScripts.displayLicense( \\'" . $alias . "\\', data )',\n\t\t\t\t\t'nnScripts.displayLicense( \\'" . $alias . "\\', \\'\\' )'\n\t\t\t\t);\n\t\t\t});\n\t\t"; $document->addScriptDeclaration($script); $html = array(); $html[] = '<div id="nonumber_license_' . $alias . '_valid" style="display: none">'; $html[] = $this->blockHTML($extension, $alias, 'valid', $host, $addmargin); $html[] = '</div>'; $html[] = '<div id="nonumber_license_' . $alias . '_invalid" style="display: none;">'; $html[] = $this->blockHTML($extension, $alias, 'invalid', $host, $addmargin); $html[] = '</div>'; $html[] = '<div id="nonumber_license_' . $alias . '_fail" style="display: none;">'; $html[] = $this->blockHTML($extension, $alias, 'fail', $host, $addmargin); $html[] = '</div>'; return implode('', $html); }
function outputHTML(&$template, &$elements) { JHTML::_('behavior.tooltip'); require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'functions.php'; $functions =& NNFunctions::getFunctions(); $mt_version = $functions->getJSVersion(); $document =& JFactory::getDocument(); $document->addStyleSheet(JURI::root(true) . '/administrator/modules/mod_addtomenu/addtomenu/css/popup.css'); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/elements/toggler' . $mt_version . '.js'); $uri =& JURI::getInstance(); ?> <form action="<?php echo $uri->toString(); ?> " method="post" name="adminForm" id="adminForm"> <input type="hidden" name="insert" value="1" /> <fieldset> <div style="float: left"> <h1><?php echo JText::_('ADD_TO_MENU'); ?> </h1> </div> <div style="float: right"> <div class="button2-left"><div class="blank hasicon apply"> <a rel="" onclick="document.getElementById('adminForm').submit();" href="javascript://" title="<?php echo JText::_('Add'); ?> "><?php echo JText::_('Add'); ?> </a> </div></div> <div class="button2-left"><div class="blank hasicon cancel"> <a rel="" onclick="window.parent.document.getElementById('sbox-window').close();" href="javascript://" title="<?php echo JText::_('Cancel'); ?> "><?php echo JText::_('Cancel'); ?> </a> </div></div> </div> <div style="clear: both;"></div> <?php echo JText::_($template->name); ?> </fieldset> <table width="100%" class="paramlist admintable" cellspacing="1"> <tbody> <?php foreach ($elements as $element) { if (!$element->name) { ?> <?php echo $element->element; ?> <?php } else { if ($element->name == '@spacer') { ?> <tr> <td colspan="2"><?php echo $element->element; ?> </td> </tr> <?php } else { ?> <tr> <td class="paramlist_key"><?php echo JText::_($element->name); ?> </td> <td><?php echo $element->element; ?> </td> </tr> <?php } } } ?> </tbody> </table> <fieldset> <div style="float: right"> <div class="button2-left"><div class="blank hasicon apply"> <a rel="" onclick="document.getElementById('adminForm').submit();" href="javascript://" title="<?php echo JText::_('Add'); ?> "><?php echo JText::_('Add'); ?> </a> </div></div> <div class="button2-left"><div class="blank hasicon cancel"> <a rel="" onclick="window.parent.document.getElementById('sbox-window').close();" href="javascript://" title="<?php echo JText::_('Cancel'); ?> "><?php echo JText::_('Cancel'); ?> </a> </div></div> </div> </fieldset> </form> <?php }
function fetchElement($name, $value, &$node) { $option = JRequest::getCmd('option'); // do not place toggler stuff on JoomFish pages if ($option == 'com_joomfish') { return; } $param = $node->attributes('param'); $value = $node->attributes('value'); $nofx = $node->attributes('nofx'); $horz = $node->attributes('horizontal'); $method = $node->attributes('method'); $overlay = $node->attributes('overlay'); $casesensitive = $node->attributes('casesensitive'); 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) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/elements/toggler' . $mt_version . '.js'); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/elements/style.css'); if ($param != '') { $set_groups = explode('|', $param); $set_values = explode('|', $value); $ids = array(); foreach ($set_groups as $i => $group) { $count = $i; if ($count >= count($set_values)) { $count = 0; } $values = explode(',', $set_values[$count]); foreach ($values as $val) { $ids[] = $group . '.' . $val; } } $html = '<div id="' . rand(1000000, 9999999) . '___' . implode('___', $ids) . '" class="nntoggler'; if ($nofx) { $html .= ' nntoggler_nofx'; } if ($horz) { $html .= ' nntoggler_horizontal'; } if ($method == 'and') { $html .= ' nntoggler_and'; } if ($overlay) { $html .= ' nntoggler_overlay'; } if ($casesensitive) { $html .= ' nntoggler_casesensitive'; } $html .= '" style="visibility: hidden;">'; $html .= '<table width="100%" class="paramlist admintable" cellspacing="1">'; $html .= '<tr style="height:auto;"><td colspan="2" class="paramlist_value">'; $random = rand(100000, 999999); $html .= '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; } else { $random = rand(100000, 999999); $html = '<div id="end-' . $random . '"></div><script type="text/javascript">NoNumberElementsHideTD( "end-' . $random . '" );</script>'; $html .= '</td></tr></table>'; $html .= '</div>'; } return $html; }
/** * 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'); } 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(); $editor =& JFactory::getEditor(); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script' . $mt_version . '.js'); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/elements/toggler' . $mt_version . '.js'); $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_HIDES_THE_MODULE_IF_ITS_OUTPUT_IS_EMPTY'); ?> "> <?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)); ?> </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); 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 }