Example #1
0
        echo '<p class="center-text ss_has_sprite" style="padding-top:5px;"><span class="ss_sprite_16 ss_delete">&#160;</span>' . $ccms['lang']['auth']['featnotallowed'] . '</p>';
    }
    exit;
}
/**
 *
 * Auto-renum ('reorder') the entire menu list
 *
 */
if ($do_action == 'reordermenu' && $_SERVER['REQUEST_METHOD'] == 'GET' && checkAuth()) {
    $error = null;
    // TODO : add interface bits to allow changing this sort order (e.g. click on headers?)
    $menu_sortorder = getGETparam4IdOrNumber('m_order', 'I12LH0');
    if ($perm->is_level_okay('manageMenu', $_SESSION['ccms_userLevel'])) {
        // Open recordset for sites' pages
        $rows = $db->SelectObjects($cfg['db_prefix'] . 'pages', null, null, cvt_ordercode2list($menu_sortorder));
        if ($rows === false) {
            $db->Kill();
        }
        // Check whether the recordset is not empty
        if (count($rows) > 0) {
            $major_level = 0;
            $minor_level = 0;
            $old_major_level = -1;
            foreach ($rows as $row) {
                if ($row->toplevel != $old_major_level) {
                    $old_major_level = $row->toplevel;
                    $major_level++;
                    $minor_level = 0;
                    $row->toplevel = $major_level;
                } else {
Example #2
0
         include $tpl_init_path;
     }
     // All parsed function contents to $content variable
     $content = ob_get_contents();
     ob_end_clean();
     $rv = array();
     $rv['content'] = $content;
     $rv['responsecode'] = $ccms_load_failure;
     return $rv;
 }
 // collect the menu entries first so we can peruse them in the breadcrumb code below.
 $menu_in_set = '1';
 for ($i = 2; $i <= MENU_TARGET_COUNT; $i++) {
     $menu_in_set .= ',' . $i;
 }
 $pagelist = $db->SelectArray($cfg['db_prefix'] . 'pages', "WHERE (`published`='Y'" . ($preview ? " OR `page_id`=" . MySQL::SQLValue($preview, MySQL::SQLVALUE_NUMBER) : '') . ") AND `menu_id` IN (" . $menu_in_set . ")", null, cvt_ordercode2list('I120'));
 if ($db->ErrorNumber()) {
     $db->Kill();
 }
 // OPERATION MODE ==
 // 2) Start site structure generation to a default maximum of MENU_TARGET_COUNT menus
 // Use the various menu item variables to get a dynamic structured list (ul). Current item marked with class="current".
 // more flexible approach than before; fewer queries (1 instead of 6..10) to boot.
 // flexibility in the sense that when user has assigned same top/sub numbers to multiple entries, this version will not b0rk
 // but dump the items in alphabetic order instead.
 // Also, when sub menu items with a top# that has no entry itself, is found, such an item will be assigned a 'dummy' top node.
 if (is_array($pagelist) && count($pagelist) > 0) {
     $current_menuID = 0;
     $current_top = 0;
     $current_structure = null;
     $top_idx = 0;