protected function getInput() { $this->params = $this->element->attributes(); $extension = $this->get('extension'); $xml = $this->get('xml'); if (!$xml && $this->form->getValue('element')) { if ($this->form->getValue('folder')) { $xml = 'plugins/' . $this->form->getValue('folder') . '/' . $this->form->getValue('element') . '/' . $this->form->getValue('element') . '.xml'; } else { $xml = 'administrator/modules/' . $this->form->getValue('element') . '/' . $this->form->getValue('element') . '.xml'; } if (!JFile::exists(JPATH_SITE . '/' . $xml)) { return ''; } } if (!strlen($extension) || !strlen($xml)) { return ''; } $authorise = JFactory::getUser()->authorise('core.manage', 'com_installer'); if (!$authorise) { return ''; } require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; return '</div><div class="hide">' . NoNumberVersions::render($extension); }
function render(&$params) { jimport('joomla.filesystem.file'); $app = JFactory::getApplication(); // Load plugin language $lang = JFactory::getLanguage(); if ($lang->getTag() != 'en-GB') { // Loads English language file as fallback (for undefined stuff in other language file) $lang->load('plg_system_sourcerer', JPATH_ADMINISTRATOR, 'en-GB'); } $lang->load('plg_system_sourcerer', JPATH_ADMINISTRATOR); $language = 'en'; foreach ($lang->getLocale() as $locale) { if (JFile::exists(JPATH_PLUGINS . '/editors-xtd/sourcerer/editarea/langs/' . $locale . '.js')) { $language = $locale; break; } } // Add scripts and styles JHtml::_('behavior.mootools'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; $sversion = NoNumberVersions::getXMLVersion('sourcerer', 'editors-xtd', null, 1); $version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document = JFactory::getDocument(); $document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/editarea/edit_area_full.js' . $sversion); $document->addScript(JURI::root(true) . '/plugins/editors-xtd/sourcerer/js/script.js' . $sversion); $script = "\n\t\t\teditAreaLoader.init({\n\t\t\t\tid: 'source',\t// id of the textarea to transform\n\t\t\t\tstart_highlight: true,\t// if start with highlight\n\t\t\t\tallow_resize: 'y',\n\t\t\t\tallow_toggle: false,\n\t\t\t\tword_wrap: true,\n\t\t\t\tlanguage: '" . $language . "',\n\t\t\t\tsyntax: 'php',\n\t\t\t\ttoolbar: 'fullscreen, |, undo, redo, |, select_font, |, syntax_selection, |, highlight, reset_highlight, word_wrap',\n\t\t\t\tsyntax_selection_allow: 'css,html,js,php'\n\t\t\t});\n\n\t\t\tvar sourcerer_syntax_word = '" . $params->syntax_word . "';\n\t\t\tvar sourcerer_editorname = '" . JRequest::getString('name', 'text') . "';\n\t\t\tvar sourcerer_default_addsourcetags = " . (int) $params->addsourcetags . ";\n\t\t\tvar sourcerer_root = '" . JURI::root(true) . "';\n\n\t\t\twindow.addEvent( 'domready', function() { sourcerer_init(); });\n\t\t"; $document->addScriptDeclaration($script); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/popup.css' . $version); $document->addStyleSheet(JURI::root(true) . '/plugins/editors-xtd/sourcerer/css/popup.css' . $sversion); $params->code = str_replace('<br />', "\n", $params->example_code_free); echo $this->getHTML($params); }
private function moduleHelperNeedsLegacy() { require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; // Return true if old JModuleHelper will be loaded by one of the following extensions if (JPluginHelper::isEnabled('system', 't3') && version_compare(NoNumberVersions::getPluginXMLVersion('t3'), '2.4.6', '<') || JPluginHelper::isEnabled('system', 'helix') && version_compare(NoNumberVersions::getPluginXMLVersion('helix'), '2.1.9', '<') || JPluginHelper::isEnabled('system', 'jsntplframework') && version_compare(NoNumberVersions::getPluginXMLVersion('jsntplframework'), '2.3.4', '<') || JPluginHelper::isEnabled('system', 'magebridge') && version_compare(NoNumberVersions::getPluginXMLVersion('magebridge'), '1.9.5295', '<') || JPluginHelper::isEnabled('system', 'metamod')) { return true; } return false; }
/** * Display the view */ function display($tpl = null) { $uri =& JFactory::getURI(); $this->request_url = $uri->toString(); $model =& $this->getModel(); $model->getData(); require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php'; // set document title $document =& JFactory::getDocument(); $version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nonumberelements/css/style.css' . $version); $version = NoNumberVersions::getXMLVersion('nonumbermanager', 'component', 1, 1); $document->addStyleSheet(JURI::root(true) . '/administrator/components/com_nonumbermanager/css/nonumbermanager.css' . $version); $document->setTitle(JText::_('NONUMBER_EXTENSION_MANAGER')); JToolBarHelper::title(JText::_('NNEM_EXTENSION_MANAGEMENT'), 'nonumbermanager'); JToolBarHelper::preferences('com_nonumbermanager', '360'); parent::display($tpl); }
public static function getPluginXMLVersion($alias, $folder = 'system') { return NoNumberVersions::getXMLVersion($alias, false, 'plugin', $folder); }
echo JText::_('NNEM_TITLE_UNINSTALL'); ?> " onclick="nnem_function('uninstall', '<?php echo $item->id; ?> ');"> <span class="icon-cancel-2"></span> </span> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> </form> </div> <?php // Copyright require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; echo NoNumberVersions::getFooter('NONUMBER_EXTENSION_MANAGER', $config->get('show_copyright', 1)); function makeSafe($str) { return str_replace(array('"', '<', '>'), array('"', '<', '>'), $str); }
" /> <input type="hidden" name="setcolor" value="" /> <?php echo JHtml::_('form.token'); ?> <?php if ($this->config->show_switch) { ?> <div style="text-align:right"> <a href="<?php echo JRoute::_('index.php?option=com_modules&force=1'); ?> "><?php echo JText::_('AMM_SWITCH_TO_CORE'); ?> </a> </div> <?php } ?> <?php // PRO Check require_once JPATH_PLUGINS . '/system/nnframework/helpers/licenses.php'; echo NoNumberLicenses::render('ADVANCED_MODULE_MANAGER'); // Copyright echo NoNumberVersions::getFooter('ADVANCED_MODULE_MANAGER'); ?> </div> </form>
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'); ?> </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 }
echo JText::_('NNEM_TITLE_UNINSTALL'); ?> " onclick="nnem_function('uninstall', '<?php echo $item->id; ?> ');"> <span class="icon-cancel-2"></span> </span> <?php } ?> </td> </tr> <?php } ?> </tbody> </table> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> </form> </div> <?php // Copyright require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; echo NoNumberVersions::getFooter('NONUMBER_EXTENSION_MANAGER', '', 0, 'nonumbermanager', 'component', $config->get('show_copyright', 1)); function makeSafe($str) { return str_replace(array('"', '<', '>'), array('"', '<', '>'), $str); }
<input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?> " /> <input type="hidden" name="setcolor" value="" /> <?php echo JHtml::_('form.token'); ?> <?php if ($this->config->show_switch) { ?> <div style="text-align:right"> <a href="<?php echo JRoute::_('index.php?option=com_modules&force=1'); ?> "><?php echo JText::_('AMM_SWITCH_TO_CORE'); ?> </a> </div> <?php } ?> <?php // Copyright echo NoNumberVersions::getFooter('ADVANCED_MODULE_MANAGER', $this->config->show_copyright); ?> </div> </form>
function onAfterDispatch() { $document =& JFactory::getDocument(); $docType = $document->getType(); // PDF if ($docType == 'pdf') { if (isset($document->_buffer)) { $this->replaceTags($document->_buffer, 0); } return; } // only in html if ($docType !== 'html' && $docType !== 'feed') { return; } // do not load scripts/styles on print page if ($docType !== 'feed' && !JRequest::getInt('print')) { if ($this->params->load_mootools) { JHTML::_('behavior.mootools'); } $version = ''; if ($this->params->use_versioned_files) { require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php'; $version = NoNumberVersions::getXMLVersion('tabber', 'system', null, 1); } $script = ' var tabber_slide_speed = ' . (int) $this->params->tabber_slide_speed . '; var tabber_fade_in_speed = ' . (int) $this->params->tabber_fade_in_speed . '; var tabber_scroll = ' . (int) $this->params->tabber_scroll . '; var tabber_tablinkscroll = ' . (int) $this->params->tabber_tablinkscroll . '; var tabber_url = \'\'; var tabber_urlscroll = \'\'; var tabber_use_cookies = ' . (int) $this->params->use_cookies . '; var tabber_set_cookies = ' . (int) $this->params->set_cookies . '; var tabber_cookie_name = \'' . $this->params->cookie_name . '\'; '; $document->addScriptDeclaration(preg_replace('#\\n\\s*#s', ' ', $script)); $document->addScript(JURI::root(true) . '/plugins/system/tabber/js/script.js' . $version); if ($this->params->load_stylesheet) { $document->addStyleSheet(JURI::root(true) . '/plugins/system/tabber/css/style.css' . $version); } $style = ''; if ($this->params->rounded && $this->params->rounded_radius && (int) $this->params->rounded_radius != 10) { $r = (int) $this->params->rounded_radius; $style .= ' div.tabber_nav { padding: 0 ' . $r . 'px; } div.tabber_container.rounded div.tabber_nav li.tabber_tab a, div.tabber_container.rounded div.tabber_nav li.tabber_tab a:hover { -webkit-border-radius: ' . $r . 'px ' . $r . 'px 0 0; -moz-border-radius: ' . $r . 'px ' . $r . 'px 0 0; border-radius: ' . $r . 'px ' . $r . 'px 0 0; } div.tabber_container.rounded div.tabber_content { -webkit-border-radius: ' . $r . 'px; -moz-border-radius: ' . $r . 'px; border-radius: ' . $r . 'px; } '; } $this->params->line_color = $this->params->outline ? '#' . $this->params->line_color : 'transparent'; if ($this->params->line_color != '#B4B4B4') { $style .= ' div.tabber_nav li.tabber_tab a, div.tabber_nav li.tabber_tab a:hover, div.tabber_content { border-color: ' . $this->params->line_color . '; } '; } if ($this->params->direction == 'rtl') { $style .= ' div.tabber_nav li.tabber_tab { float: right; } div.tabber_content { clear: right; } '; } if ($style) { $document->addStyleDeclaration(preg_replace('#\\n\\s*#s', ' ', $style)); } } $buffer = $document->getBuffer('component'); if (!$buffer || strpos($buffer, '{' . $this->params->tag_open) === false) { return; } $this->params->hasitems = 1; $this->protect($buffer); $this->replaceTags($buffer); $this->unprotect($buffer); $document->setBuffer($buffer, 'component'); }
JHTML::_('behavior.mootools'); JHTML::_('behavior.tooltip'); $model =& $this->getModel(); $exts = array(); foreach ($model->extensions as $alias => $extension) { if ($alias != 'all') { $exts[] = "{ name: '" . $extension->name . "', id: '" . $extension->id . "', alias: '" . $extension->alias . "', types: '" . $extension->type . "' }"; } } $config =& JComponentHelper::getParams('com_nonumbermanager'); $check_data = $config->get('check_data', 1); require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php'; $document =& JFactory::getDocument(); $version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js' . $version); $version = NoNumberVersions::getXMLVersion('nonumbermanager', 'component', 1, 1); $document->addScript(JURI::root(true) . '/administrator/components/com_nonumbermanager/js/script.js' . $version); $script = "\n\tvar nn_extensions = [ " . implode(', ', $exts) . " ];\n\n\twindow.addEvent( 'domready', function() {\n\t\tnnManager.load_extensions( " . $check_data . " );\n\t});\n\n\t/* NoNumber! Extension Manager variable */\n\tvar NNEM_NONESELECTED =\t\t\t'" . JText::_('NNEM_NO_ITEMS_SELECTED') . "';\n\tvar NNEM_AREYOUSURE =\t\t\t'" . JText::_('NNEM_ARE_YOU_SURE') . "';\n\tvar NNEM_UPTODATE =\t\t\t\t'" . JText::_('NNEM_ALREADY_UPTODATE') . "';\n\tvar NNEM_DOWNGRADE =\t\t\t'" . JText::_('NNEM_DOWNGRADE') . "';\n\tvar NNEM_INSTALLING =\t\t\t'" . JText::_('NNEM_INSTALLING') . "';\n\tvar NNEM_UPDATING =\t\t\t\t'" . JText::_('NNEM_UPDATING') . "';\n\tvar NNEM_REINSTALLING =\t\t\t'" . JText::_('NNEM_REINSTALLING') . "';\n\tvar NNEM_DOWNGRADING =\t\t\t'" . JText::_('NNEM_DOWNGRADING') . "';\n\tvar NNEM_MAYTAKEAWHILE =\t\t'" . JText::_('NNEM_MAY_TAKE_A_WHILE') . "';\n\tvar NNEM_EXTENSIONSINSTALLED =\t'" . JText::_('NNEM_EXTENSIONS_INSTALLED') . "';\n\tvar NNEM_CLEANCACHE =\t\t\t'" . JText::_('NNEM_CLEAN_CACHE') . "';\n\tvar NNEM_EXTENSIONSUPDATED =\t'" . JText::_('NNEM_EXTENSIONS_UPDATED') . "';\n\tvar NNEM_INSTALLATIONFAILED =\t'" . JText::_('NNEM_INSTALLATION_FAILED') . "';\n\tvar NNEM_CHANGELOG =\t\t\t'" . JText::_('NNEM_CHANGELOG') . "';\n\tvar NNEM_TOKEN =\t\t\t\t'" . JUtility::getToken() . "';\n"; if ($config->get('use_proxy', 0) && $config->get('proxy_host')) { $script .= "\tvar NNEM_QUERY = 'url_options[CURLOPT_PROXY]='+escape( '" . $config->get('proxy_host') . "' )+':'+escape( '" . $config->get('proxy_port') . "' )" . "+'&url_options[CURLOPT_PROXYUSERPWD]='+escape( '" . $config->get('proxy_login') . "' )+':'+escape( '" . $config->get('proxy_password') . "' )" . "+'&url_options[CURLOPT_TIMEOUT]=30';"; } else { $script .= "\tvar NNEM_QUERY = '';"; } $document->addScriptDeclaration(' ' . trim($script)); echo html_entity_decode(JText::_('NNEM_EXTENSION_MANAGEMENT_DESC'), ENT_COMPAT, 'UTF-8'); ?> <p></p> <form action="<?php echo JRoute::_($this->request_url); ?> " method="post" name="adminForm" id="adminForm">
function outputHTML(&$template, &$elements) { JHtml::_('behavior.tooltip'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; $version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/popup.css' . $version); $document->addScript(JURI::root(true) . '/plugins/system/nnframework/js/script.js' . $version); $document->addScript(JURI::root(true) . '/plugins/system/nnframework/fields/toggler.js' . $version); $uri = JURI::getInstance(); ?> <form action="<?php echo $uri->toString(); ?> " method="post" name="adminForm" id="adminForm"> <input type="hidden" name="insert" value="1" /> <div id="toolbar-box" class="nn-toolbar-box"> <div class="m"> <div id="toolbar" class="toolbar-list"> <ul> <li id="toolbar-save" class="button"> <a class="toolbar" onclick="document.getElementById('adminForm').submit();" href="javascript://"> <span class="icon-32-save"> </span> <?php echo JText::_('JAPPLY'); ?> </a> </li> <li id="toolbar-cancel" class="button"> <a class="toolbar" onclick="window.parent.SqueezeBox.close();" href="javascript://"> <span class="icon-32-cancel"> </span> <?php echo JText::_('JCANCEL'); ?> </a> </li> </ul> <div class="clr"></div> </div> <div class="pagetitle"> <?php echo JText::_('ADD_TO_MENU'); ?> <h2><?php echo JText::_($template->name); ?> </h2> </div> </div> </div> <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> </form> <?php }
function render() { $option = JRequest::getCmd('option'); $this->vars = array(); jimport('joomla.filesystem.folder'); jimport('joomla.filesystem.file'); $comp_file = ''; $folder = JPATH_ADMINISTRATOR . '/components/' . $option . '/addtomenu'; if (!JFolder::exists($folder)) { $folder = JPATH_ADMINISTRATOR . '/modules/mod_addtomenu/addtomenu/components/' . $option; } foreach (JFolder::files($folder, '.xml') as $filename) { $file = $folder . '/' . $filename; $xml = JFactory::getXMLParser('Simple'); $xml->loadFile($file); if (isset($xml->document) && isset($xml->document->_children)) { $template = $this->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; } $opt = $option; // load the admin language file if ($opt == 'com_categories') { $opt = JRequest::getCmd('extension', 'com_content'); } $lang = JFactory::getLanguage(); if ($lang->getTag() != 'en-GB') { // Loads English language file as fallback (for undefined stuff in other language file) $lang->load('mod_addtomenu', JPATH_ADMINISTRATOR, 'en-GB'); $lang->load($opt, JPATH_ADMINISTRATOR, 'en-GB'); $lang->load($opt . '.sys', JPATH_ADMINISTRATOR, 'en-GB'); } $lang->load('mod_addtomenu', JPATH_ADMINISTRATOR, null, 1); $lang->load($opt, JPATH_ADMINISTRATOR, null, 1); $lang->load($opt . '.sys', JPATH_ADMINISTRATOR, null, 1); JHtml::_('behavior.modal'); require_once JPATH_PLUGINS . '/system/nnframework/helpers/versions.php'; $version = NoNumberVersions::getXMLVersion('addtomenu', 'module', 1, 1); $nn_version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document = JFactory::getDocument(); $document->addStyleSheet(JURI::root(true) . '/plugins/system/nnframework/css/status.css' . $nn_version); $document->addScript(JURI::root(true) . '/administrator/modules/mod_addtomenu/addtomenu/js/script.js' . $version); $document->addStyleSheet(JURI::root(true) . '/administrator/modules/mod_addtomenu/addtomenu/css/style.css' . $version); // set height for popup $popup_width = 600 + (int) $this->params->adjust_modal_w; $popup_height = 320 + (int) $this->params->adjust_modal_h; if (isset($template->adjust_height)) { $popup_height += (int) $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->values->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::_($this->params->icon_text); $title = $text; $class = ''; if ($this->params->display_link == 'text') { $class = 'no_icon'; } else { if ($this->params->display_link == 'icon') { $text = ''; $class = 'no_text'; } } if ($this->params->display_tooltip) { JHtml::_('behavior.tooltip'); $class .= ' hasTip'; $title = JText::_('ADD_TO_MENU') . '::' . JText::_($template->name); } $html = '<a href="' . $link . '" onfocus="this.blur();" class="nn_status_link modal" rel="{handler: \'iframe\', size: {x: ' . $popup_width . ', y: ' . $popup_height . '}}"><span class="nn_status_text ' . $class . '" title="' . $title . '">' . $text . '</span></a>'; $html = '<span class="addtomenu_status nn_status">' . $html . '</span>'; echo $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'); } $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 }
*/ // No direct access. defined('_JEXEC') or die; JHtml::addIncludePath(JPATH_COMPONENT . '/helpers/html'); JHTML::_('behavior.mootools'); JHtml::_('behavior.tooltip'); JHtml::_('behavior.formvalidation'); JHtml::_('behavior.combobox'); $hasContent = empty($this->item->module) || $this->item->module == 'custom' || $this->item->module == 'mod_custom'; $script = "Joomla.submitbutton = function(task)\n\t{\n\t\t\tif (task == 'module.cancel' || document.formvalidator.isValid(document.id('module-form'))) {"; if ($hasContent) { $script .= $this->form->getField('content')->save(); } $script .= "\tJoomla.submitform(task, document.getElementById('module-form'));\n\t\t\t\tif (self != top) {\n\t\t\t\t\twindow.top.setTimeout('window.parent.SqueezeBox.close()', 1000);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\talert('" . $this->escape(JText::_('JGLOBAL_VALIDATION_FORM_FAILED')) . "');\n\t\t\t}\n\t}"; require_once JPATH_PLUGINS . DS . 'system' . DS . 'nonumberelements' . DS . 'helpers' . DS . 'versions.php'; $version = NoNumberVersions::getXMLVersion(null, null, null, 1); $document =& JFactory::getDocument(); $document->addScriptDeclaration($script); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/js/script.js' . $version); $document->addScript(JURI::root(true) . '/plugins/system/nonumberelements/fields/toggler.js' . $version); $script = "\n\twindow.addEvent( 'domready', function() {\n\t\tif ( !nnTogglerSet ) {\n\t\t\tnnTogglerSet = new nnToggler();\n\t\t}\n\t});\n"; /*if ( $this->config->show_color ) { $colors = explode( ',', $this->config->main_colors ); foreach ( $colors as $i=> $c ) { $colors[$i] = strtoupper( '#'.preg_replace( '#[^a-z0-9]#i', '', $c ) ); } $script .= " mainColors = new Array( '".implode( "', '", $colors )."' );"; }*/ $document->addScriptDeclaration($script); ?>