/** * Form for copying item(s) to a specific menu */ function copyMenu($option, $cid, $menutype) { global $database; if (!is_array($cid) || count($cid) < 1) { echo "<script> alert('" . T_('Select an item to move') . "'); window.history.go(-1);</script>\n"; exit; } ## query to list selected menu items $cids = implode(',', $cid); $query = "SELECT a.name FROM #__menu AS a WHERE a.id IN ( " . $cids . " )"; $database->setQuery($query); $items = $database->loadObjectList(); $menuTypes = mosAdminMenus::menutypes(); foreach ($menuTypes as $menuType) { $menu[] = mosHTML::makeOption($menuType, $menuType); } // build the html select list $MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null); HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype); }
/** * Form for copying item(s) to a specific menu */ function copyMenu($option, $cid, $menutype) { global $database, $adminLanguage; if (!is_array($cid) || count($cid) < 1) { echo "<script> alert('" . $adminLanguage->A_COMP_CATEG_ITEM_MOVE . "'); window.history.go(-1);</script>\n"; exit; } ## query to list selected menu items $cids = implode(',', $cid); $query = "SELECT a.name FROM #__menu AS a WHERE a.id IN ( " . $cids . " )"; $database->setQuery($query); $items = $database->loadObjectList(); ## query to choose menu $query = "SELECT a.params FROM #__modules AS a WHERE a.module = 'mod_mainmenu' ORDER BY a.title"; $database->setQuery($query); $modules = $database->loadObjectList(); foreach ($modules as $module) { $params = mosParseParams($module->params); // adds menutype to array $type = trim(@$params->menutype); $menu[] = mosHTML::makeOption($type, $type); } // build the html select list $MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null); HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype); }
/** * Form for copying item(s) to a specific menu */ function copyMenu($option, $cid, $menutype) { global $database; if (!is_array($cid) || count($cid) < 1) { echo "<script> alert('Selecione um item para mover'); window.history.go(-1);</script>\n"; exit; } ## query to list selected menu items mosArrayToInts($cid); $cids = 'a.id=' . implode(' OR a.id=', $cid); $query = "SELECT a.name" . "\n FROM #__menu AS a" . "\n WHERE ( {$cids} )"; $database->setQuery($query); $items = $database->loadObjectList(); $menuTypes = mosAdminMenus::menutypes(); foreach ($menuTypes as $menuType) { $menu[] = mosHTML::makeOption($menuType, $menuType); } // build the html select list $MenuList = mosHTML::selectList($menu, 'menu', 'class="inputbox" size="10"', 'value', 'text', null); HTML_menusections::copyMenu($option, $cid, $MenuList, $items, $menutype); }