function editDhtmlMenu() { $absolute_path = JPATH_ROOT; if (!file_exists($absolute_path . '/modules/mod_swmenufree/mod_swmenufree.xml')) { echo "<dl id=\"system-message\"><dt class=\"message\">Message</dt>\n\t\t<dd class=\"\"><ul><li>swMenuFree module is missing</li>\n\t </ul></dd></dl>\n"; upgrade('com_swmenufree'); } else { $config =& JFactory::getConfig(); $dbprefix = $config->get('dbprefix'); $db = $config->get('db'); $database =& JFactory::getDBO(); $sql = "SELECT COUNT(*) FROM #__modules where module='mod_swmenufree' and published > -1"; $database->setQuery($sql); $modcount = $database->loadResult(); if ($modcount > 1) { echo "<dl id=\"system-message\"><dt class=\"message\">Message</dt>\n\t\t<dd class=\"\"><ul><li>More Than one swMenuFree module has been detected. This will cause errors. Please remove one of the swMenuFree modules using the Joomla module manager</li>\n\t </ul></dd></dl>\n"; } $sql = "SELECT id FROM #__modules where module='mod_swmenufree' AND published > -1"; $database->setQuery($sql); $id = $database->loadResult(); $row =& JTable::getInstance('module'); // load the row from the db table $row->load($id); $sql = "SELECT * FROM #__swmenufree_styles where id=1"; $database->setQuery($sql); $swmenufree = $database->loadObject(); $params = sw_stringToObject($swmenufree->params); $row2 = new stdClass(); //$row2=array(); while (list($key, $val) = each($params)) { $row2->{$key} = $val; } $lists = array(); $cssload[] = JHTML::_('select.option', '0', _SW_CSS_DYNAMIC_SELECT); $cssload[] = JHTML::_('select.option', '1', _SW_CSS_LINK_SELECT); //$cssload[]= JHTML::_('select.option', '2', _SW_CSS_IMPORT_SELECT ); $cssload[] = JHTML::_('select.option', '3', _SW_CSS_NONE_SELECT); $lists['cssload'] = JHTML::_('select.genericlist', $cssload, 'cssload', 'id="cssload" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->cssload ? $row2->cssload : '0'); $tables[] = JHTML::_('select.option', '0', _SW_SHOW_TABLES_SELECT); $tables[] = JHTML::_('select.option', '1', _SW_SHOW_BLOGS_SELECT); $lists['tables'] = JHTML::_('select.genericlist', $tables, 'tables', 'id="tables" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->tables ? $row2->tables : '0'); //echo $menutype; if ($row2->menustyle == "mygosumenu") { $extra2[] = JHTML::_('select.option', 'none', _SW_SPECIAL_EFFECTS_NONE); $extra2[] = JHTML::_('select.option', 'slide', _SW_SPECIAL_EFFECTS_SLIDE); $extra2[] = JHTML::_('select.option', 'fade', _SW_SPECIAL_EFFECTS_FADE); // $extra2[]= JHTML::_('select.option', 'slide/fade', "Slide and Fade" ); $lists['extra'] = JHTML::_('select.genericlist', $extra2, 'extra', 'id="extra" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->extra ? $row2->extra : 'none'); } if ($row2->menustyle == "superfishmenu") { $extra2[] = JHTML::_('select.option', 'none', _SW_SPECIAL_EFFECTS_NONE); $extra2[] = JHTML::_('select.option', 'fade', 'Fade'); $extra2[] = JHTML::_('select.option', 'slide-down', 'Slide Down'); $extra2[] = JHTML::_('select.option', 'slide-right', "Slide Right"); $lists['extra'] = JHTML::_('select.genericlist', $extra2, 'extra', 'id="extra" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->extra ? $row2->extra : 'none'); } if ($row2->menustyle == "transmenu") { $extra2[] = JHTML::_('select.option', '0', _SW_SPECIAL_EFFECTS_NONE); $extra2[] = JHTML::_('select.option', '1', "Submenu Shadow"); //$extra2[]= JHTML::_('select.option', 'fade', _SW_SPECIAL_EFFECTS_FADE ); // $extra2[]= JHTML::_('select.option', 'slide/fade', "Slide and Fade" ); $lists['extra'] = JHTML::_('select.genericlist', $extra2, 'extra', 'id="extra" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->extra ? $row2->extra : 'none'); } $lists['levels'] = JHTML::_('select.integerlist', 0, 10, 1, 'levels', 'class="inputbox" size="1" style="width:200px"', $row2->levels); $cssload = array(); $cssload[] = JHTML::_('select.option', 'none', 'none'); $cssload[] = JHTML::_('select.option', 'curvycorner', 'curvyCorners'); $cssload[] = JHTML::_('select.option', 'round', 'Round'); $cssload[] = JHTML::_('select.option', 'bevel', 'Bevel'); $cssload[] = JHTML::_('select.option', 'notch', 'Notch'); $cssload[] = JHTML::_('select.option', 'bite', 'Bite'); $cssload[] = JHTML::_('select.option', 'cool', 'Cool'); $cssload[] = JHTML::_('select.option', 'sharp', 'Sharp'); $cssload[] = JHTML::_('select.option', 'slide', 'Slide'); $cssload[] = JHTML::_('select.option', 'jut', 'Jut'); $cssload[] = JHTML::_('select.option', 'curl', 'Curl'); $cssload[] = JHTML::_('select.option', 'tear', 'Tear'); $cssload[] = JHTML::_('select.option', 'fray', 'Fray'); $cssload[] = JHTML::_('select.option', 'wicked', 'Wicked'); $cssload[] = JHTML::_('select.option', 'sculpt', 'Sculpt'); $cssload[] = JHTML::_('select.option', 'long', 'Long'); $cssload[] = JHTML::_('select.option', 'dog', 'Dog Ear 1'); $cssload[] = JHTML::_('select.option', 'dog2', 'Dog Ear 2'); $cssload[] = JHTML::_('select.option', 'dog3', 'Dog Ear 3'); //$row2->c_corner_size=$c_corner_size; $lists['c_corner_style'] = JHTML::_('select.genericlist', $cssload, 'c_corner_style', 'id="c_corner_style" onchange="do_complete_corner();" class="inputbox" size="1" style="width:200px"', 'value', 'text', $row2->c_corner_style); //$lists['c_corner_size'] = JHTML::_('select.integerlist',0,100,1, 'c_corner_size', 'onchange="do_complete_corner();" id="c_corner_size" class="inputbox"', $c_corner_size ); $lists['c_corner_size'] = "<input type='text' name='c_corner_size' onchange='do_complete_corner();' id='c_corner_size' class='inputbox' size='3' value='" . $row2->c_corner_size . "' >"; $lists['t_corner_style'] = JHTML::_('select.genericlist', $cssload, 't_corner_style', 'id="t_corner_style" onchange="do_top_corner();" class="inputbox" size="1" style="width:200px"', 'value', 'text', $row2->t_corner_style); //$lists['t_corner_size'] = JHTML::_('select.integerlist',0,100,1, 't_corner_size', 'class="inputbox"', $t_corner_size ); $lists['t_corner_size'] = "<input type='text' name='t_corner_size' onchange='do_top_corner();' id='t_corner_size' class='inputbox' size='3' value='" . $row2->t_corner_size . "' >"; $lists['s_corner_style'] = JHTML::_('select.genericlist', $cssload, 's_corner_style', 'id="s_corner_style" onchange="do_sub_corner();" class="inputbox" size="1" style="width:200px"', 'value', 'text', $row2->s_corner_style); $lists['s_corner_size'] = "<input type='text' name='s_corner_size' onchange='do_sub_corner();' id='s_corner_size' class='inputbox' size='3' value='" . $row2->s_corner_size . "' >"; if (@$row2->ctl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['ctl_corner'] = "<input type='checkbox' onchange='do_complete_corner();' id='ctl_corner' name='ctl_corner' value='1' " . $tex . " />"; if (@$row2->ctr_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['ctr_corner'] = "<input type='checkbox' onchange='do_complete_corner()' id='ctr_corner' name='ctr_corner' value='1' " . $tex . " />"; if (@$row2->cbl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['cbl_corner'] = "<input type='checkbox' onchange='do_complete_corner()' id='cbl_corner' name='cbl_corner' value='1' " . $tex . " />"; if (@$row2->cbr_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['cbr_corner'] = "<input type='checkbox' onchange='do_complete_corner()' id='cbr_corner' name='cbr_corner' value='1' " . $tex . " />"; if (@$row2->ttl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['ttl_corner'] = "<input type='checkbox' onchange='do_top_corner();' id='ttl_corner' name='ttl_corner' value='1' " . $tex . " />"; if (@$row2->ttr_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['ttr_corner'] = "<input type='checkbox' onchange='do_top_corner();' id='ttr_corner' name='ttr_corner' value='1' " . $tex . " />"; if (@$row2->tbl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['tbl_corner'] = "<input type='checkbox' onchange='do_top_corner();' id='tbl_corner' name='tbl_corner' value='1' " . $tex . " />"; if (@$row2->tbr_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['tbr_corner'] = "<input type='checkbox' onchange='do_top_corner();' id='tbr_corner' name='tbr_corner' value='1' " . $tex . " />"; if (@$row2->stl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['stl_corner'] = "<input type='checkbox' onchange='do_sub_corner();' id='stl_corner' name='stl_corner' value='1' " . $tex . " />"; if (@$row2->str_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['str_corner'] = "<input type='checkbox' onchange='do_sub_corner();' id='str_corner' name='str_corner' value='1' " . $tex . " />"; if (@$row2->sbl_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['sbl_corner'] = "<input type='checkbox' onchange='do_sub_corner();' id='sbl_corner' name='sbl_corner' value='1' " . $tex . " />"; if (@$row2->sbr_corner == 1) { $tex = "checked='checked'"; } else { $tex = ""; } $lists['sbr_corner'] = "<input type='checkbox' onchange='do_sub_corner();' id='sbr_corner' name='sbr_corner' value='1' " . $tex . " />"; $lists['top_sub_indicator'] = "<img id='top_sub' src='../" . ($row2->top_sub_indicator ? $row2->top_sub_indicator : 'modules/mod_swmenufree/images/empty.gif') . "' align='middle' /><input type='hidden' id='top_sub_indicator' name='top_sub_indicator' value='" . $row2->top_sub_indicator . "' />"; $lists['sub_sub_indicator'] = "<img id='sub_sub' src='../" . ($row2->sub_sub_indicator ? $row2->sub_sub_indicator : 'modules/mod_swmenufree/images/empty.gif') . "' align='middle' /><input type='hidden' id='sub_sub_indicator' name='sub_sub_indicator' value='" . $row2->sub_sub_indicator . "' />"; $lists['top_sub_indicator_top'] = "<input type=\"text\" size=\"4\" id=\"top_sub_indicator_top\" name=\"top_sub_indicator_top\" value=\"" . $row2->top_sub_indicator_top . "\" />"; $lists['top_sub_indicator_left'] = "<input type=\"text\" size=\"4\" id=\"top_sub_indicator_left\" name=\"top_sub_indicator_left\" value=\"" . $row2->top_sub_indicator_left . "\" />"; $lists['sub_sub_indicator_top'] = "<input type=\"text\" size=\"4\" id=\"sub_sub_indicator_top\" name=\"sub_sub_indicator_top\" value=\"" . $row2->sub_sub_indicator_top . "\" />"; $lists['sub_sub_indicator_left'] = "<input type=\"text\" size=\"4\" id=\"sub_sub_indicator_left\" name=\"sub_sub_indicator_left\" value=\"" . $row2->sub_sub_indicator_left . "\" />"; $yesno = array(); $yesno[] = JHTML::_('select.option', '1', _SW_YES); $yesno[] = JHTML::_('select.option', '0', _SW_NO); $lists['active_menu'] = JHTML::_('select.genericlist', $yesno, 'active_menu', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->active_menu); $lists['padding_hack'] = JHTML::_('select.genericlist', $yesno, 'padding_hack', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->padding_hack); $lists['auto_position'] = JHTML::_('select.genericlist', $yesno, 'auto_position', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->auto_position); $lists['overlay_hack'] = JHTML::_('select.genericlist', $yesno, 'overlay_hack', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->overlay_hack); $lists['disable_jquery'] = JHTML::_('select.genericlist', $yesno, 'disable_jquery', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->disable_jquery); $lists['flash_hack'] = JHTML::_('select.genericlist', $yesno, 'flash_hack', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->flash_hack); $lists['hybrid'] = JHTML::_('select.genericlist', $yesno, 'hybrid', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->hybrid); $lists['tablet_hack'] = JHTML::_('select.genericlist', $yesno, 'tablet_hack', 'class="inputbox" size="1" style="width:100px;"', 'value', 'text', $row2->tablet_hack); // build the html select list for published // $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ? $row->published : 0); $query = 'SELECT DISTINCT #__menu.menutype AS value FROM #__menu'; $database->setQuery($query); $menutypes = $database->loadObjectList(); //$menutypes3[]= JHTML::_('select.option', '-999', 'Select Source Menu' ); //$menutypes3[]= JHTML::_('select.option', '-999', '-----------------' ); $menutypes3[] = JHTML::_('select.option', 'swcontentmenu', _SW_SOURCE_CONTENT_SELECT); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); if (TableExists($dbprefix . "virtuemart_configs")) { $menutypes3[] = JHTML::_('select.option', 'virtuemart2', 'Virtuemart2 Categories'); $menutypes3[] = JHTML::_('select.option', 'virtueprod2', 'Virtuemart2 Products'); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); } else { if (TableExists($dbprefix . "vm_category")) { $menutypes3[] = JHTML::_('select.option', 'virtuemart', 'Virtuemart Categories'); $menutypes3[] = JHTML::_('select.option', 'virtueprod', 'Virtuemart Products'); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); } } if (file_exists($absolute_path . "/components/com_mtree/mtree.php")) { $menutypes3[] = JHTML::_('select.option', 'mosetstree', 'Mosets Tree component'); //$menutypes3[]= JHTML::_('select.option', 'virtueprod', 'Virtuemart Products' ); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); } $menutypes3[] = JHTML::_('select.option', '-999', _SW_SOURCE_EXISTING_SELECT); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); foreach ($menutypes as $menutypes2) { $menutypes3[] = JHTML::_('select.option', addslashes($menutypes2->value), addslashes($menutypes2->value)); } $lists['menutype'] = JHTML::_('select.genericlist', $menutypes3, 'menutype', ' id="menutype" class="inputbox" size="1" style="width:200px" onchange="changeDynaList(\'parentid\',orders2,document.getElementById(\'menutype\').options[document.getElementById(\'menutype\').selectedIndex].value, originalPos2, originalOrder2);"', 'value', 'text', $row2->menutype ? $row2->menutype : 'mainmenu'); $categories3[] = JHTML::_('select.option', 0, 'TOP'); $sql = "SELECT DISTINCT #__categories.id AS value, #__categories.title AS text, #__categories.extension, #__categories.level AS level\n FROM #__categories \n INNER JOIN #__content ON #__content.catid = #__categories.id\n WHERE #__categories.published = 1\n AND #__categories.extension='com_content'\n ORDER BY #__categories.lft\n \n "; $database->setQuery($sql); $categories = $database->loadObjectList(); foreach ($categories as $categories2) { $categories3[] = JHTML::_('select.option', $categories2->value, str_repeat("- ", $categories2->level) . $categories2->text); } foreach ($categories3 as $category) { $menuitems['swcontentmenu'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); } if (file_exists($absolute_path . "/components/com_virtuemart/virtuemart.php")) { $categories4[] = JHTML::_('select.option', 0, 'All Categories (top)'); if (TableExists($dbprefix . "virtuemart_configs")) { $sql = "SELECT #__virtuemart_configs.config\n FROM #__virtuemart_configs\n WHERE #__virtuemart_configs.virtuemart_config_id=1"; $database->setQuery($sql); $result = $database->loadResult(); $config = explode('|', $result); foreach ($config as $item) { $item = explode('=', $item); if (!empty($item[1])) { // if($item[0]!=='offline_message' && $item[0]!=='dateformat' ){ if ($item[0] !== 'offline_message') { $pair[$item[0]] = unserialize($item[1]); } else { $pair[$item[0]] = unserialize(base64_decode($item[1])); } } else { $pair[$item[0]] = ''; } } $vmlang = $pair['vmlang'] ? $pair['vmlang'] : "en_gb"; //echo $vmlang; $sql = "SELECT DISTINCT #__virtuemart_categories_" . $vmlang . ".virtuemart_category_id AS value, #__virtuemart_categories_" . $vmlang . ".category_name AS text\n FROM #__virtuemart_categories_" . $vmlang; } else { $sql = "SELECT DISTINCT #__vm_category.category_id AS value, #__vm_category.category_name AS text\n FROM #__vm_category "; } $database->setQuery($sql); $sections = $database->loadObjectList(); $categories4[] = JHTML::_('select.option', -999, '--------'); $categories4[] = JHTML::_('select.option', -999, 'Categories'); $categories4[] = JHTML::_('select.option', -999, '--------'); foreach ($sections as $sections2) { $categories4[] = JHTML::_('select.option', $sections2->value + 10000, $sections2->text); } foreach ($categories4 as $category) { $menuitems['virtuemart'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); $menuitems['virtueprod'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); $menuitems['virtuemart2'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); $menuitems['virtueprod2'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); } } $menuitems2 = array(); $database->setQuery("SELECT m.*" . "\n FROM #__menu m" . "\n WHERE published = '1'" . "\n AND parent_id!='0'" . "\n ORDER BY menutype, parent_id"); $mitems = $database->loadObjectList(); $mitems_temp = $mitems; // establish the hierarchy of the menu $children = array(); // first pass - collect children foreach ($mitems as $v) { $id = $v->id; $pt = $v->parent_id; $list = @$children[$pt] ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } // second pass - get an indent list of the items $list = swmenuTreeRecurse(intval($mitems[0]->parent_id), '', array(), $children); // Code that adds menu name to Display of Page(s) $text_count = "0"; $mitems_spacer = ""; foreach ($list as $list_a) { foreach ($mitems_temp as $mitems_a) { if ($mitems_a->id == $list_a->id) { // Code that inserts the blank line that seperates different menus if ($mitems_a->menutype != $mitems_spacer) { //$list_temp[] = JHTML::_('select.option', -99, "----------" ); $list_temp[] = JHTML::_('select.option', -99, "--------------"); $list_temp[] = JHTML::_('select.option', -99, $mitems_a->menutype); $list_temp[] = JHTML::_('select.option', -99, "--------------"); $menuitems[$mitems_a->menutype][] = JHTML::_('select.option', 0, "TOP"); $mitems_spacer = $mitems_a->menutype; } $text = addslashes("- " . $list_a->treename); $text2 = addslashes($list_a->treename); $list_temp[] = JHTML::_('select.option', $list_a->id, $text); $menuitems[$mitems_a->menutype][] = JHTML::_('select.option', $list_a->id, $text2); if (strlen($text) > $text_count) { $text_count = strlen($text); } } } } $list = $list_temp; $align[] = JHTML::_('select.option', 'left', 'left'); $align[] = JHTML::_('select.option', 'right', 'right'); $lists['top_sub_indicator_align'] = JHTML::_('select.genericlist', $align, 'top_sub_indicator_align', 'id="top_sub_indicator_align" size="1" class="inputbox" style="width:100px"', 'value', 'text', $row2->top_sub_indicator_align); $lists['sub_sub_indicator_align'] = JHTML::_('select.genericlist', $align, 'sub_sub_indicator_align', 'id="sub_sub_indicator_align" size="1" class="inputbox" style="width:100px"', 'value', 'text', $row2->sub_sub_indicator_align); $align = array(); $align[] = JHTML::_('select.option', '', 'none'); $align[] = JHTML::_('select.option', 'italic', 'italic'); $align[] = JHTML::_('select.option', 'oblique', 'oblique'); $align[] = JHTML::_('select.option', 'underline', 'underline'); $align[] = JHTML::_('select.option', 'line-through', 'line-through'); $align[] = JHTML::_('select.option', 'overline', 'overline'); $align[] = JHTML::_('select.option', 'uppercase', 'uppercase'); $align[] = JHTML::_('select.option', 'lowercase', 'lowercase'); $align[] = JHTML::_('select.option', 'capitalize', 'capitalize'); $lists['top_font_extra'] = JHTML::_('select.genericlist', $align, 'top_font_extra', 'id="top_font_extra" onchange="do_top_font_extra();" size="1" class="inputbox"', 'value', 'text', $row2->top_font_extra); $lists['sub_font_extra'] = JHTML::_('select.genericlist', $align, 'sub_font_extra', 'id="sub_font_extra" onchange="do_sub_font_extra();" size="1" class="inputbox"', 'value', 'text', $row2->sub_font_extra); $yesno = array(); $yesno[] = JHTML::_('select.option', 'normal', "Wrap text"); $yesno[] = JHTML::_('select.option', 'nowrap', "No text Wrapping"); $lists['top_wrap'] = JHTML::_('select.genericlist', $yesno, 'top_wrap', 'class="inputbox" size="1" id="top_wrap" onchange="jQuery(\'.top_preview\').css(\'white-space\',this.value);" ', 'value', 'text', $row2->top_wrap); $lists['sub_wrap'] = JHTML::_('select.genericlist', $yesno, 'sub_wrap', 'class="inputbox" size="1" id="sub_wrap" onchange="jQuery(\'.sub_preview\').css(\'white-space\',this.value);"', 'value', 'text', $row2->sub_wrap); $cssload = array(); $cssload[] = JHTML::_('select.option', 'none', 'none'); $cssload[] = JHTML::_('select.option', 'solid', 'solid'); $cssload[] = JHTML::_('select.option', 'dashed', 'dashed'); $cssload[] = JHTML::_('select.option', 'inset', 'inset'); $cssload[] = JHTML::_('select.option', 'outset', 'outset'); $cssload[] = JHTML::_('select.option', 'groove', 'groove'); $cssload[] = JHTML::_('select.option', 'double', 'double'); $lists['main_border_style'] = JHTML::_('select.genericlist', $cssload, 'main_border_style', 'id="main_border_style" class="inputbox" onchange="doMainBorder();" size="1" style="width:100px"', 'value', 'text', $row2->main_border_style); $lists['sub_border_style'] = JHTML::_('select.genericlist', $cssload, 'sub_border_style', 'id="sub_border_style" class="inputbox" onchange="doSubBorder();" size="1" style="width:100px"', 'value', 'text', $row2->sub_border_style); $lists['main_border_over_style'] = JHTML::_('select.genericlist', $cssload, 'main_border_over_style', 'id="main_border_over_style" class="inputbox" onchange="doMainBorder();" size="1" style="width:100px"', 'value', 'text', $row2->main_border_over_style); $lists['sub_border_over_style'] = JHTML::_('select.genericlist', $cssload, 'sub_border_over_style', 'id="sub_border_over_style" class="inputbox" onchange="doSubBorder();" size="1" style="width:100px"', 'value', 'text', $row2->sub_border_over_style); $cssload = array(); $cssload[] = JHTML::_('select.option', 'Arial, Helvetica, sans-serif', 'Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', 'Times New Roman, Times, serif', 'Times New Roman, Times, serif'); $cssload[] = JHTML::_('select.option', 'Georgia, Times New Roman, Times, serif', 'Georgia, Times New Roman, Times, serif'); $cssload[] = JHTML::_('select.option', 'Verdana, Arial, Helvetica, sans-serif', 'Verdana, Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', 'Geneva, Arial, Helvetica, sans-serif', 'Geneva, Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', 'Tahoma, Arial, sans-serif', 'Tahoma, Arial, sans-serif'); $lists['font_family'] = JHTML::_('select.genericlist', $cssload, 'font_family', 'id="font_family" onchange="jQuery(\'.top_preview\').css(\'font-family\',this.value);" class="inputbox" size="1" style="width:230px"', 'value', 'text', $row2->font_family); $lists['sub_font_family'] = JHTML::_('select.genericlist', $cssload, 'sub_font_family', 'id="sub_font_family" onchange="jQuery(\'.sub_preview\').css(\'font-family\',this.value);" class="inputbox" size="1" style="width:230px"', 'value', 'text', $row2->sub_font_family); $cssload = array(); $cssload[] = JHTML::_('select.option', 'normal', 'normal'); $cssload[] = JHTML::_('select.option', 'bold', 'bold'); $cssload[] = JHTML::_('select.option', 'bolder', 'bolder'); $cssload[] = JHTML::_('select.option', 'lighter', 'lighter'); $lists['font_weight'] = JHTML::_('select.genericlist', $cssload, 'font_weight', 'id="font_weight" onchange="jQuery(\'.top_preview\').css(\'font-weight\',this.value);" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->font_weight); $lists['font_weight_over'] = JHTML::_('select.genericlist', $cssload, 'font_weight_over', 'id="font_weight_over" onchange="jQuery(\'.sub_preview\').css(\'font-weight\',this.value);" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->font_weight_over); $cssload = array(); $cssload[] = JHTML::_('select.option', 'left', 'left'); $cssload[] = JHTML::_('select.option', 'right', 'right'); $cssload[] = JHTML::_('select.option', 'center', 'center'); $cssload[] = JHTML::_('select.option', 'justify', 'justify'); $lists['main_align'] = JHTML::_('select.genericlist', $cssload, 'main_align', 'id="main_align" onchange="jQuery(\'.top_preview\').css(\'text-align\',this.value);" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->main_align); $lists['sub_align'] = JHTML::_('select.genericlist', $cssload, 'sub_align', 'id="sub_align" onchange="jQuery(\'.sub_preview\').css(\'text-align\',this.value);" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->sub_align); $cssload = array(); $cssload[] = JHTML::_('select.option', 'left', 'left'); $cssload[] = JHTML::_('select.option', 'right', 'right'); $cssload[] = JHTML::_('select.option', 'center', 'center'); $lists['position'] = JHTML::_('select.genericlist', $cssload, 'position', 'id="position" class="inputbox" size="1" style="width:120px"', 'value', 'text', $row2->position ? $row2->position : '0'); $cssload = array(); $cssload[] = JHTML::_('select.option', 'left top', 'left top'); $cssload[] = JHTML::_('select.option', 'left center', 'left center'); $cssload[] = JHTML::_('select.option', 'left bottom', 'left bottom'); $cssload[] = JHTML::_('select.option', 'right top', 'right top'); $cssload[] = JHTML::_('select.option', 'right center', 'right center'); $cssload[] = JHTML::_('select.option', 'right bottom', 'right bottom'); $cssload[] = JHTML::_('select.option', 'center top', 'center top'); $cssload[] = JHTML::_('select.option', 'center center', 'center center'); $cssload[] = JHTML::_('select.option', 'center bottom', 'center bottom'); $lists['complete_background_position'] = JHTML::_('select.genericlist', $cssload, 'complete_background_position', 'id="complete_background_position" class="inputbox" size="1" onchange="$(\'#top_preview_outer\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->complete_background_position ? $row2->complete_background_position : 'left top'); $lists['active_background_position'] = JHTML::_('select.genericlist', $cssload, 'active_background_position', 'id="active_background_position" class="inputbox" size="1" onchange="$(\'#top_preview_active\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->active_background_position ? $row2->active_background_position : 'left top'); $lists['top_background_position'] = JHTML::_('select.genericlist', $cssload, 'top_background_position', 'id="top_background_position" class="inputbox" size="1" onchange="$(\'.top_preview.normal\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->top_background_position ? $row2->top_background_position : 'left top'); $lists['top_hover_background_position'] = JHTML::_('select.genericlist', $cssload, 'top_hover_background_position', 'id="top_hover_background_position" class="inputbox" size="1" onchange="$(\'#top_preview_hover\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->top_hover_background_position ? $row2->top_hover_background_position : 'left top'); $lists['sub_background_position'] = JHTML::_('select.genericlist', $cssload, 'sub_background_position', 'id="sub_background_position" class="inputbox" size="1" onchange="$(\'#sub_preview_outer\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->sub_background_position ? $row2->sub_background_position : 'left top'); $lists['sub_hover_background_position'] = JHTML::_('select.genericlist', $cssload, 'sub_hover_background_position', 'id="sub_hover_background_position" class="inputbox" size="1" onchange="$(\'#sub_preview_hover\').css(\'background-position\',this.value);" style="width:120px"', 'value', 'text', $row2->sub_hover_background_position ? $row2->sub_hover_background_position : 'left top'); $cssload = array(); $cssload[] = JHTML::_('select.option', 'repeat', 'repeat'); $cssload[] = JHTML::_('select.option', 'repeat-x', 'repeat-x'); $cssload[] = JHTML::_('select.option', 'repeat-y', 'repeat-y'); $cssload[] = JHTML::_('select.option', 'no-repeat', 'no-repeat'); $lists['complete_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'complete_background_repeat', 'id="complete_background_repeat" class="inputbox" size="1" onchange="$(\'#top_preview_outer\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->complete_background_repeat ? $row2->complete_background_repeat : 'repeat'); $lists['active_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'active_background_repeat', 'id="active_background_repeat" class="inputbox" size="1" onchange="$(\'#top_preview_active\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->active_background_repeat ? $row2->active_background_repeat : 'repeat'); $lists['top_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'top_background_repeat', 'id="top_background_repeat" class="inputbox" size="1" onchange="$(\'.top_preview.normal\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->top_background_repeat ? $row2->top_background_repeat : 'repeat'); $lists['top_hover_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'top_hover_background_repeat', 'id="top_hover_background_repeat" class="inputbox" size="1" onchange="$(\'#top_preview_hover\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->top_hover_background_repeat ? $row2->top_hover_background_repeat : 'repeat'); $lists['sub_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'sub_background_repeat', 'id="sub_background_repeat" class="inputbox" size="1" onchange="$(\'#sub_preview_outer\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->sub_background_repeat ? $row2->sub_background_repeat : 'repeat'); $lists['sub_hover_background_repeat'] = JHTML::_('select.genericlist', $cssload, 'sub_hover_background_repeat', 'id="sub_hover_background_repeat" class="inputbox" size="1" onchange="$(\'#sub_preview_hover\').css(\'background-repeat\',this.value);" style="width:100px"', 'value', 'text', $row2->sub_hover_background_repeat ? $row2->sub_hover_background_repeat : 'repeat'); $cssload = array(); if ($row2->menustyle == "transmenu" || $row2->menustyle == "mygosumenu") { $cssload[] = JHTML::_('select.option', 'horizontal/down', 'horizontal/down/right'); $cssload[] = JHTML::_('select.option', 'vertical/right', 'vertical/right'); $cssload[] = JHTML::_('select.option', 'horizontal/up', 'horizontal/up'); $cssload[] = JHTML::_('select.option', 'vertical/left', 'vertical/left'); $cssload[] = JHTML::_('select.option', 'horizontal/left', 'horizontal/down/left'); } else { $cssload[] = JHTML::_('select.option', 'horizontal', 'horizontal'); $cssload[] = JHTML::_('select.option', 'vertical', 'vertical'); } $lists['orientation'] = JHTML::_('select.genericlist', $cssload, 'orientation', 'id="orientation" onchange="change_orientation();" class="inputbox" size="1" style="width:160px"', 'value', 'text', $row2->orientation ? $row2->orientation : '0'); $basedir = $absolute_path . "/modules/mod_swmenufree/fonts/"; $handle = opendir($basedir); $font = array(); $font[] = JHTML::_('select.option', "", "None"); while ($file = readdir($handle)) { if ($file == "." || $file == ".." || $file == "default.ini") { } else { $filename = file_get_contents('' . $absolute_path . '/modules/mod_swmenufree/fonts/' . $file . ''); $pos_start = strpos($filename, "font-family") + 14; $pos_end = strpos($filename, "\"", $pos_start) - $pos_start; $fontname = substr($filename, $pos_start, $pos_end); $font[] = JHTML::_('select.option', $file, $fontname); } } $lists['topTTF'] = JHTML::_('select.genericlist', $font, 'top_ttf', 'id="top_ttf" onchange="do_top_ttf();" class="inputbox" size="1" style="width:200px"', 'value', 'text', $row2->top_ttf); $lists['subTTF'] = JHTML::_('select.genericlist', $font, 'sub_ttf', 'id="sub_ttf" onchange="do_sub_ttf();" class="inputbox" size="1" style="width:200px"', 'value', 'text', $row2->sub_ttf); closedir($handle); $cssload = array(); $cssload[] = JHTML::_('select.option', 'transmenu', _SW_TRANS_MENU); $cssload[] = JHTML::_('select.option', 'mygosumenu', _SW_MYGOSU_MENU); //$cssload[]= JHTML::_('select.option', 'tigramenu', _SW_TIGRA_MENU ); $cssload[] = JHTML::_('select.option', 'superfishmenu', _SW_SUPERFISH_MENU); $lists['menustyle'] = JHTML::_('select.genericlist', $cssload, 'menustyle', 'id="menustyle" class="inputbox" size="1" onChange="changeOrientation();" style="width:200px"', 'value', 'text', $row2->menustyle ? $row2->menustyle : 'transmenu'); HTML_swmenufree::MenuConfig($row2, $row, $lists, $menuitems); HTML_swmenufree::footer(); } }
function editDhtmlMenu($id, $option) { global $my, $mainframe; global $lang, $offset; $absolute_path = JPATH_ROOT; $config =& JFactory::getConfig(); $dbprefix = $config->getValue('config.dbprefix'); $db = $config->getValue('config.db'); $database =& JFactory::getDBO(); $sql = "SELECT id FROM #__modules where module='mod_swmenufree'"; $database->setQuery($sql); $id = $database->loadResult(); $swmenufree_array = array(); $now = date("Y-m-d H:i:s", time() + $offset * 60 * 60); $row =& JTable::getInstance('module'); // load the row from the db table $row->load($id); $registry = new JRegistry(); $registry->loadINI($row->params); $params = $registry->toObject(); $menu = @$params->menutype ? $params->menutype : 'mainmenu'; $menustyle = @$params->menustyle ? $params->menustyle : 'transmenu'; $hybrid = @$params->hybrid ? $params->hybrid : 0; $css_load = @$params->cssload ? $params->cssload : 0; $use_table = @$params->tables ? $params->tables : 0; $moduleID = @$params->moduleID; $parent_id = @$params->parentid ? $params->parentid : '0'; $modulename = $row->title; $cache = @$params->cache ? $params->cache : 0; $moduleclass_sfx = @$params->moduleclass_sfx ? $params->moduleclass_sfx : ""; $cache_time = @$params->cache_time ? $params->cache_time : "1 hour"; $active_menu = @$params->active_menu ? $params->active_menu : 0; $parent_level = @$params->parent_level ? $params->parent_level : 0; $levels = @$params->levels ? $params->levels : 0; $onload_hack = @$params->onload_hack ? $params->onload_hack : 0; $editor_hack = @$params->editor_hack ? $params->editor_hack : 0; $overlay_hack = @$params->overlay_hack ? $params->overlay_hack : 0; $sub_indicator = @$params->sub_indicator ? $params->sub_indicator : 2; $selectbox_hack = @$params->selectbox_hack ? $params->selectbox_hack : 0; $auto_position = @$params->auto_position ? $params->auto_position : 0; $padding_hack = @$params->padding_hack ? $params->padding_hack : 0; $show_shadow = @$params->show_shadow ? $params->show_shadow : 0; $template = @$params->template ? $params->template : ""; $language = @$params->language ? $params->language : "*"; $component = @$params->component ? $params->component : ""; if (!$id) { $menustyle = JRequest::getVar('menutype', "superfishmenu"); } $row2 = new swmenufreeMenu($database); $row2->load('1'); if (!$row2->id) { if (!$row2->gosumenu()) { echo "<script> alert('" . $row->getError() . "'); window.history.go(-1); </script>\n"; exit; } $row2->id = 1; } $padding1 = explode("px", $row2->main_padding); $padding2 = explode("px", $row2->sub_padding); for ($i = 0; $i < 4; $i++) { $padding1[$i] = trim($padding1[$i]); $padding2[$i] = trim($padding2[$i]); } $border1 = explode(" ", $row2->main_border); $border2 = explode(" ", $row2->sub_border); $border1[0] = rtrim(trim($border1[0]), 'px'); $border2[0] = rtrim(trim($border2[0]), 'px'); $border1[1] = trim($border1[1]); $border2[1] = trim($border2[1]); $border1[2] = trim($border1[2]); $border2[2] = trim($border2[2]); $border3 = explode(" ", $row2->main_border_over); $border4 = explode(" ", $row2->sub_border_over); $border3[0] = rtrim(trim($border3[0]), 'px'); $border4[0] = rtrim(trim($border4[0]), 'px'); $border3[1] = trim($border3[1]); $border4[1] = trim($border4[1]); $border3[2] = trim($border3[2]); $border4[2] = trim($border4[2]); $database->setQuery("SELECT position, ordering, showtitle, title FROM #__modules WHERE client_id=0" . "\nORDER BY ordering"); if (!($orders = $database->loadObjectList())) { echo $database->stderr(); return false; } //print_r($orders); $lists = array(); // build the order lists to be used to make the javascript arrays // hard code options for now $orders2 = array(); $orders2['left'] = array(); $orders2['right'] = array(); $orders2['top'] = array(); $orders2['bottom'] = array(); $orders2['inset'] = array(); $orders2['user1'] = array(); $orders2['user2'] = array(); if (!(defined('_JLEGACY') && _JLEGACY == '1.0')) { $orders2 = getPositions(); } //while (list ($key) = each ($pos2[0])) //{ // $orders2[$key]=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 . '::' . addslashes($orders[$i]->title)); } // make an array for the left and right positions foreach (array_keys($orders2) as $v) { $ord = count(array_keys($orders2[$v])) + 1; $orders2[$v][] = JHTML::_('select.option', $ord, $ord . '::last'); ##$pos[] = JHTML::_('select.option', 'left' ); ##$pos[] = JHTML::_('select.option', 'right' ); $pos[] = JHTML::_('select.option', $v); } //$pos3=getPositions(); //echo count($orders2); //echo $pos3[0]; // build the html select list $lists['module_position'] = JHTML::_('select.genericlist', $pos, 'position2', 'class="inputbox" size="1" onchange="changeDynaList(\'ordering\',orders,this.options[this.selectedIndex].value, originalPos, originalOrder);"', 'value', 'text', $row->position ? $row->position : 'left'); // get selected pages for $lists['selections'] $query = 'SELECT menuid AS value FROM #__modules_menu WHERE moduleid=' . $id; $database->setQuery($query); $lookup = $database->loadObjectList(); $cssload[] = JHTML::_('select.option', '0', _SW_CSS_DYNAMIC_SELECT); $cssload[] = JHTML::_('select.option', '1', _SW_CSS_LINK_SELECT); //$cssload[]= JHTML::_('select.option', '2', _SW_CSS_IMPORT_SELECT ); $cssload[] = JHTML::_('select.option', '3', _SW_CSS_NONE_SELECT); $lists['cssload'] = JHTML::_('select.genericlist', $cssload, 'cssload', 'id="cssload" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $css_load ? $css_load : '0'); $cachet[] = JHTML::_('select.option', '10 seconds', _SW_10SECOND_SELECT); $cachet[] = JHTML::_('select.option', '1 minute', _SW_1MINUTE_SELECT); $cachet[] = JHTML::_('select.option', '30 minutes', _SW_30MINUTE_SELECT); $cachet[] = JHTML::_('select.option', '1 hour', _SW_1HOUR_SELECT); $cachet[] = JHTML::_('select.option', '6 hours', _SW_6HOUR_SELECT); $cachet[] = JHTML::_('select.option', '12 hours', _SW_12HOUR_SELECT); $cachet[] = JHTML::_('select.option', '1 day', _SW_1DAY_SELECT); $cachet[] = JHTML::_('select.option', '3 days', _SW_3DAY_SELECT); $cachet[] = JHTML::_('select.option', '1 week', _SW_1WEEK_SELECT); $lists['cache_time'] = JHTML::_('select.genericlist', $cachet, 'cache_time', 'id="cache_time" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $cache_time ? $cache_time : '1 hour'); $tables[] = JHTML::_('select.option', '1', _SW_SHOW_TABLES_SELECT); $tables[] = JHTML::_('select.option', '0', _SW_SHOW_BLOGS_SELECT); $lists['tables'] = JHTML::_('select.genericlist', $tables, 'tables', 'id="tables" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $use_table ? $use_table : '0'); $lists['parent_level'] = JHTML::_('select.integerlist', 0, 10, 1, 'parent_level', 'class="inputbox"', $parent_level); $lists['levels'] = JHTML::_('select.integerlist', 0, 10, 1, 'levels', 'class="inputbox"', $levels); $lists['hybrid'] = JHTML::_('select.booleanlist', 'hybrid', 'class="inputbox"', $hybrid); $lists['active_menu'] = JHTML::_('select.booleanlist', 'active_menu', 'class="inputbox"', $active_menu); $lists['auto_position'] = JHTML::_('select.booleanlist', 'auto_position', 'class="inputbox"', $auto_position); $lists['padding_hack'] = JHTML::_('select.booleanlist', 'padding_hack', 'class="inputbox"', $padding_hack); $lists['cache'] = JHTML::_('select.booleanlist', 'cache', 'class="inputbox"', $cache); $lists['onload_hack'] = JHTML::_('select.booleanlist', 'onload_hack', 'class="inputbox"', $onload_hack); $lists['editor_hack'] = JHTML::_('select.booleanlist', 'editor_hack', 'class="inputbox"', $editor_hack); $lists['overlay_hack'] = JHTML::_('select.booleanlist', 'overlay_hack', 'class="inputbox"', $overlay_hack); $subindicator[] = JHTML::_('select.option', '0', 'none'); $subindicator[] = JHTML::_('select.option', '1', 'text arrows'); $subindicator[] = JHTML::_('select.option', '2', 'white arrows'); $subindicator[] = JHTML::_('select.option', '3', 'black arrows'); $subindicator[] = JHTML::_('select.option', '4', 'grey arrows'); $subindicator[] = JHTML::_('select.option', '5', 'blue arrows'); $subindicator[] = JHTML::_('select.option', '6', 'red arrows'); $subindicator[] = JHTML::_('select.option', '7', 'green arrows'); $subindicator[] = JHTML::_('select.option', '8', 'yellow arrows'); $lists['sub_indicator'] = JHTML::_('select.genericlist', $subindicator, 'sub_indicator', 'id="sub_indicator" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $sub_indicator ? $sub_indicator : '0'); $lists['selectbox_hack'] = JHTML::_('select.booleanlist', 'selectbox_hack', 'class="inputbox"', $selectbox_hack); $lists['show_shadow'] = JHTML::_('select.booleanlist', 'show_shadow', 'class="inputbox"', $show_shadow); $lists['showtitle'] = JHTML::_('select.booleanlist', 'showtitle', 'class="inputbox"', $row->showtitle ? $row->showtitle : 0); $lists['access'] = JHTML::_('list.accesslevel', $row); // build the html select list for published $lists['published'] = JHTML::_('select.booleanlist', 'published', 'class="inputbox"', $row->published ? $row->published : 0); $query = 'SELECT DISTINCT #__menu.menutype AS value FROM #__menu'; $database->setQuery($query); $menutypes = $database->loadObjectList(); //$menutypes3[]= JHTML::_('select.option', '-999', 'Select Source Menu' ); //$menutypes3[]= JHTML::_('select.option', '-999', '-----------------' ); $menutypes3[] = JHTML::_('select.option', 'swcontentmenu', _SW_SOURCE_CONTENT_SELECT); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); if (file_exists($absolute_path . "/components/com_virtuemart/virtuemart.php")) { $menutypes3[] = JHTML::_('select.option', 'virtuemart', 'Virtuemart Component'); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); } $menutypes3[] = JHTML::_('select.option', '-999', _SW_SOURCE_EXISTING_SELECT); $menutypes3[] = JHTML::_('select.option', '-999', '-----------------'); foreach ($menutypes as $menutypes2) { $menutypes3[] = JHTML::_('select.option', addslashes($menutypes2->value), addslashes($menutypes2->value)); } $lists['menutype'] = JHTML::_('select.genericlist', $menutypes3, 'menutype', ' id="menutype" class="inputbox" size="1" style="width:200px" onchange="changeDynaList(\'parentid\',orders2,document.getElementById(\'menutype\').options[document.getElementById(\'menutype\').selectedIndex].value, originalPos2, originalOrder2);"', 'value', 'text', $menu ? $menu : 'mainmenu'); $categories3[] = JHTML::_('select.option', 0, 'TOP'); $categories3[] = JHTML::_('select.option', -999, '----------'); $categories3[] = JHTML::_('select.option', -999, 'Categories'); $categories3[] = JHTML::_('select.option', -999, '----------'); $sql = "SELECT DISTINCT #__categories.id AS value, #__categories.title AS text, #__categories.extension, #__categories.level AS level\r\r\n FROM #__categories \r\r\n INNER JOIN #__content ON #__content.catid = #__categories.id\r\r\n WHERE #__categories.published = 1\r\r\n AND #__categories.extension='com_content'\r\r\n ORDER BY #__categories.lft\r\r\n \r\r\n "; $database->setQuery($sql); $categories = $database->loadObjectList(); foreach ($categories as $categories2) { $categories3[] = JHTML::_('select.option', $categories2->value, str_repeat("- ", $categories2->level) . $categories2->text); } foreach ($categories3 as $category) { $menuitems['swcontentmenu'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); } if (file_exists($absolute_path . "/components/com_virtuemart/virtuemart.php")) { $categories4[] = JHTML::_('select.option', 0, 'All Categories (top)'); $sql = "SELECT DISTINCT #__vm_category.category_id AS value, #__vm_category.category_name AS text\r\r\n FROM #__vm_category "; $database->setQuery($sql); $sections = $database->loadObjectList(); $categories4[] = JHTML::_('select.option', -999, '--------'); $categories4[] = JHTML::_('select.option', -999, 'Categories'); $categories4[] = JHTML::_('select.option', -999, '--------'); foreach ($sections as $sections2) { $categories4[] = JHTML::_('select.option', $sections2->value, $sections2->text); } foreach ($categories4 as $category) { $menuitems['virtuemart'][] = JHTML::_('select.option', $category->value, addslashes($category->text)); } } $menuitems2 = array(); $database->setQuery("SELECT m.*" . "\n FROM #__menu m" . "\n WHERE published = '1'" . "\n AND parent_id!='0'" . "\n ORDER BY menutype, parent_id, ordering"); $mitems = $database->loadObjectList(); $mitems_temp = $mitems; // establish the hierarchy of the menu $children = array(); // first pass - collect children foreach ($mitems as $v) { $id = $v->id; $pt = $v->parent_id; $list = @$children[$pt] ? $children[$pt] : array(); array_push($list, $v); $children[$pt] = $list; } // second pass - get an indent list of the items $list = swmenuTreeRecurse(intval($mitems[0]->parent_id), '', array(), $children); // Code that adds menu name to Display of Page(s) $text_count = "0"; $mitems_spacer = ""; foreach ($list as $list_a) { foreach ($mitems_temp as $mitems_a) { if ($mitems_a->id == $list_a->id) { // Code that inserts the blank line that seperates different menus if ($mitems_a->menutype != $mitems_spacer) { //$list_temp[] = JHTML::_('select.option', -99, "----------" ); $list_temp[] = JHTML::_('select.option', -99, "--------------"); $list_temp[] = JHTML::_('select.option', -99, $mitems_a->menutype); $list_temp[] = JHTML::_('select.option', -99, "--------------"); $menuitems[$mitems_a->menutype][] = JHTML::_('select.option', 0, "TOP"); $mitems_spacer = $mitems_a->menutype; } $text = addslashes("- " . $list_a->treename); $text2 = addslashes($list_a->treename); $list_temp[] = JHTML::_('select.option', $list_a->id, $text); $menuitems[$mitems_a->menutype][] = JHTML::_('select.option', $list_a->id, $text2); if (strlen($text) > $text_count) { $text_count = strlen($text); } } } } $list = $list_temp; $mitems2 = array(); $mitems2[] = JHTML::_('select.option', 0, 'All'); $mitems2[] = JHTML::_('select.option', -99, '----'); $mitems2[] = JHTML::_('select.option', -999, 'None'); foreach ($list as $item) { $mitems2[] = JHTML::_('select.option', $item->value, $item->text); } $lists['selections'] = JHTML::_('select.genericlist', $mitems2, 'selections[]', 'class="inputbox" size="20" style="width:580px" multiple="multiple"', 'value', 'text', $lookup ? $lookup : 0); $database->setQuery("SELECT DISTINCT #__template_styles.template AS text FROM #__template_styles WHERE client_id=0"); $list = $database->loadObjectList(); $template2 = array(); $template2[] = JHTML::_('select.option', "All", 'All'); //$template[] = JHTML::_('select.option', -99, '----' ); //$template[] = JHTML::_('select.option', -999, 'None' ); foreach ($list as $item) { $template2[] = JHTML::_('select.option', $item->text, $item->text); } $lists['templates'] = JHTML::_('select.genericlist', $template2, 'template', 'class="inputbox" style="width:130px" ', 'text', 'text', $template); if (TableExists($dbprefix . "languages", $db)) { $database->setQuery("SELECT DISTINCT #__languages.title AS text, #__languages.lang_code AS value FROM #__languages"); $list = $database->loadObjectList(); $language2 = array(); $language2[] = JHTML::_('select.option', "*", 'All'); //$template[] = JHTML::_('select.option', -99, '----' ); //$template[] = JHTML::_('select.option', -999, 'None' ); foreach ($list as $item) { $language2[] = JHTML::_('select.option', $item->value, $item->text); } $lists['languages'] = JHTML::_('select.genericlist', $language2, 'language', 'class="inputbox" style="width:130px" ', 'value', 'text', $row->language); } else { $lists['languages'] = "Default"; } $database->setQuery("SELECT DISTINCT #__extensions.name AS text, #__extensions.element AS value FROM #__extensions WHERE client_id=0 AND type='component'"); $list = $database->loadObjectList(); $component2 = array(); $component2[] = JHTML::_('select.option', "All", 'All'); $component2[] = JHTML::_('select.option', "com_content", 'Content'); //$template[] = JHTML::_('select.option', -999, 'None' ); foreach ($list as $item) { $component2[] = JHTML::_('select.option', $item->value, $item->text); } $lists['components'] = JHTML::_('select.genericlist', $component2, 'component', 'class="inputbox" style="width:130px" ', 'value', 'text', $component); $align[] = JHTML::_('select.option', 'left', 'left'); $align[] = JHTML::_('select.option', 'right', 'right'); $align[] = JHTML::_('select.option', 'texttop', 'texttop'); $align[] = JHTML::_('select.option', 'absmiddle', 'absmiddle'); $align[] = JHTML::_('select.option', 'baseline', 'baseline'); $align[] = JHTML::_('select.option', 'absbottom', 'absbottom'); $align[] = JHTML::_('select.option', 'bottom', 'bottom'); $align[] = JHTML::_('select.option', 'middle', 'middle'); $align[] = JHTML::_('select.option', 'top', 'top'); $lists['align'] = JHTML::_('select.genericlist', $align, 'tree-image_align', 'id="tree-image_align" class="inputbox" onchange="treeInfoUpdate();"', 'value', 'text', ''); //$lists['showname'] = JHTML::_('select.genericlist', 'tree-image_showname', 'class="inputbox" id="tree-image_showname" onchange="treeInfoUpdate();"', 1 ); //$lists['target'] = JHTML::_('select.genericlist', 'tree-image_target', 'class="inputbox" id="tree-image_target" onchange="treeInfoUpdate();"', 1 ); //$lists['showitem'] = JHTML::_('select.genericlist', 'tree-image_showitem', 'class="inputbox" id="tree-image_showitem" onchange="treeInfoUpdate();"', 1 ); $cssload = array(); $cssload[] = JHTML::_('select.option', 'none', 'none'); $cssload[] = JHTML::_('select.option', 'solid', 'solid'); $cssload[] = JHTML::_('select.option', 'dashed', 'dashed'); $cssload[] = JHTML::_('select.option', 'inset', 'inset'); $cssload[] = JHTML::_('select.option', 'outset', 'outset'); $cssload[] = JHTML::_('select.option', 'grooved', 'grooved'); $cssload[] = JHTML::_('select.option', 'double', 'double'); $lists['main_border_style'] = JHTML::_('select.genericlist', $cssload, 'main_border_style', 'id="main_border_style" class="inputbox" onchange="doMainBorder();" size="1" style="width:100px"', 'value', 'text', $border1[1]); $lists['sub_border_style'] = JHTML::_('select.genericlist', $cssload, 'sub_border_style', 'id="sub_border_style" class="inputbox" onchange="doSubBorder();" size="1" style="width:100px"', 'value', 'text', $border2[1]); $lists['main_border_over_style'] = JHTML::_('select.genericlist', $cssload, 'main_border_over_style', 'id="main_border_over_style" class="inputbox" onchange="doMainBorder();" size="1" style="width:100px"', 'value', 'text', $border3[1]); $lists['sub_border_over_style'] = JHTML::_('select.genericlist', $cssload, 'sub_border_over_style', 'id="sub_border_over_style" class="inputbox" onchange="doSubBorder();" size="1" style="width:100px"', 'value', 'text', $border4[1]); $cssload = array(); $cssload[] = JHTML::_('select.option', 'Arial, Helvetica, sans-serif', 'Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', '\'Times New Roman\', Times, serif', 'Times New Roman, Times, serif'); $cssload[] = JHTML::_('select.option', 'Georgia, \'Times New Roman\', Times, serif', 'Georgia, Times New Roman, Times, serif'); $cssload[] = JHTML::_('select.option', 'Verdana, Arial, Helvetica, sans-serif', 'Verdana, Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', 'Geneva, Arial, Helvetica, sans-serif', 'Geneva, Arial, Helvetica, sans-serif'); $cssload[] = JHTML::_('select.option', 'Tahoma, Arial, sans-serif', 'Tahoma, Arial, sans-serif'); $lists['font_family'] = JHTML::_('select.genericlist', $cssload, 'font_family', 'id="font_family" class="inputbox" size="1" style="width:230px"', 'value', 'text', $row2->font_family); $lists['sub_font_family'] = JHTML::_('select.genericlist', $cssload, 'sub_font_family', 'id="sub_font_family" class="inputbox" size="1" style="width:230px"', 'value', 'text', $row2->sub_font_family); $cssload = array(); $cssload[] = JHTML::_('select.option', 'normal', 'normal'); $cssload[] = JHTML::_('select.option', 'bold', 'bold'); $cssload[] = JHTML::_('select.option', 'bolder', 'bolder'); $cssload[] = JHTML::_('select.option', 'lighter', 'lighter'); $lists['font_weight'] = JHTML::_('select.genericlist', $cssload, 'font_weight', 'id="font_weight" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->font_weight); $lists['font_weight_over'] = JHTML::_('select.genericlist', $cssload, 'font_weight_over', 'id="font_weight_over" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->font_weight_over); $cssload = array(); $cssload[] = JHTML::_('select.option', 'left', 'left'); $cssload[] = JHTML::_('select.option', 'right', 'right'); $cssload[] = JHTML::_('select.option', 'center', 'center'); $cssload[] = JHTML::_('select.option', 'justify', 'justify'); $lists['main_align'] = JHTML::_('select.genericlist', $cssload, 'main_align', 'id="main_align" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->main_align); $lists['sub_align'] = JHTML::_('select.genericlist', $cssload, 'sub_align', 'id="sub_align" class="inputbox" size="1" style="width:100px"', 'value', 'text', $row2->sub_align); $cssload = array(); if ($menustyle == "tigramenu") { $cssload[] = JHTML::_('select.option', 'absolute', 'absolute'); $cssload[] = JHTML::_('select.option', 'relative', 'relative'); } else { $cssload[] = JHTML::_('select.option', 'left', 'left'); $cssload[] = JHTML::_('select.option', 'right', 'right'); $cssload[] = JHTML::_('select.option', 'center', 'center'); } $lists['position'] = JHTML::_('select.genericlist', $cssload, 'position', 'id="position" class="inputbox" size="1" style="width:120px"', 'value', 'text', $row2->position ? $row2->position : '0'); $cssload = array(); $cssload[] = JHTML::_('select.option', 'transmenu', _SW_TRANS_MENU); $cssload[] = JHTML::_('select.option', 'mygosumenu', _SW_MYGOSU_MENU); $cssload[] = JHTML::_('select.option', 'tigramenu', _SW_TIGRA_MENU); $cssload[] = JHTML::_('select.option', 'superfishmenu', _SW_SUPERFISH_MENU); $lists['menustyle'] = JHTML::_('select.genericlist', $cssload, 'menustyle', 'id="menustyle" class="inputbox" size="1" onChange="changeOrientation();" style="width:200px"', 'value', 'text', $menustyle ? $menustyle : 'transmenu'); $cssload = array(); if ($menustyle == "transmenu") { $cssload[] = JHTML::_('select.option', 'horizontal/down', 'horizontal/down/right'); $cssload[] = JHTML::_('select.option', 'vertical/right', 'vertical/right'); $cssload[] = JHTML::_('select.option', 'horizontal/up', 'horizontal/up'); $cssload[] = JHTML::_('select.option', 'vertical/left', 'vertical/left'); $cssload[] = JHTML::_('select.option', 'horizontal/left', 'horizontal/down/left'); } else { $cssload[] = JHTML::_('select.option', 'horizontal', 'horizontal'); $cssload[] = JHTML::_('select.option', 'vertical', 'vertical'); } $lists['orientation'] = JHTML::_('select.genericlist', $cssload, 'orientation', 'id="orientation" class="inputbox" size="1" style="width:120px"', 'value', 'text', $row2->orientation ? $row2->orientation : '0'); $extra2[] = JHTML::_('select.option', '0', _SW_SPECIAL_EFFECTS_NONE); $extra2[] = JHTML::_('select.option', '1', 'fade in'); $extra2[] = JHTML::_('select.option', '2', 'slide down'); $extra2[] = JHTML::_('select.option', '3', 'slide right'); $extra2[] = JHTML::_('select.option', '4', 'fade in - slide down'); $extra2[] = JHTML::_('select.option', '5', 'fade in - slide right'); //$extra2[]= JHTML::_('select.option', '6', 'slide down' ); $lists['extra'] = JHTML::_('select.genericlist', $extra2, 'extra', 'id="extra" class="inputbox" size="1" style="width:200px" ', 'value', 'text', $row2->extra ? $row2->extra : 'none'); //echo $menustyle; HTML_swmenufree::MenuConfig($menustyle, $row2, $row, $menu, $padding1, $padding2, $border1, $border2, $border3, $border4, $modulename, $parent_id, $orders2, $lists, $menuitems, $moduleclass_sfx); HTML_swmenufree::footer(); }