Exemplo n.º 1
0
/**
* Form for moving item(s) to a specific menu
*/
function moveMenu($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::moveMenu($option, $cid, $MenuList, $items, $menutype);
}
Exemplo n.º 2
0
/**
* Form for moving item(s) to a specific menu
*/
function moveMenu($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();
    ## query to choose menu
    $query = "SELECT a.params" . "\n FROM #__modules AS a" . "\n WHERE a.module = 'mod_mainmenu'" . "\n 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::moveMenu($option, $cid, $MenuList, $items, $menutype);
}