Ejemplo n.º 1
0
function saveMenu($id, $data, $menu)
{
    if (!empty($menu) && count($menu) > 0) {
        foreach ($menu as $key => $value) {
            if (!empty($value['id']) && $value['id'] == $id) {
                $menu[$key] = $data;
                if (isset($value['sub'])) {
                    $menu[$key]['sub'] = $value['sub'];
                }
                break;
            }
            if (!empty($value['sub']) && count($value['sub']) > 0) {
                $menu[$key]['sub'] = saveMenu($id, $data, $value['sub']);
            }
        }
    }
    return $menu;
}
Ejemplo n.º 2
0
* @copyright (C) 2000 - 2004 Miro International Pty Ltd
* @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
* Mambo is Free Software
*/
/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
//$types[] = mosHTML::makeOption( 'new_item', 'Content Item' );
$types[] = mosHTML::makeOption('content_archive_section', 'Section Archive Blog');
$reqpath = "{$mosConfig_absolute_path}/administrator/components/com_menus/content_archive_section";
require_once "{$reqpath}/content_archive_section.class.php";
require_once "{$reqpath}/content_archive_section.menu.html.php";
switch ($task) {
    case "content_archive_section":
        // this is the new item, ie, the same name as the menu `type`
        content_archive_section_menu::editSection(0, $menutype, $option);
        break;
    case "edit":
        content_archive_section_menu::editSection($cid[0], $menutype, $option);
        break;
    case "save":
        // no special handling
        saveMenu($option);
        break;
    case "publish":
    case "unpublish":
        // no special action
        break;
    case "remove":
        // no special action
        break;
}
<?php

/**
* @package Mambo
* @subpackage Menus
* @author Mambo Foundation Inc see README.php
* @copyright Mambo Foundation Inc.
* See COPYRIGHT.php for copyright notices and details.
* @license GNU/GPL Version 2, see LICENSE.php
* Mambo is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; version 2 of the License.
*/
/** ensure this file is being included by a parent file */
defined('_VALID_MOS') or die('Direct Access to this location is not allowed.');
mosAdminMenus::menuItem($type);
switch ($task) {
    case 'newsfeed_category_table':
        // this is the new item, ie, the same name as the menu `type`
        newsfeed_category_table_menu::editCategory(0, $menutype, $option);
        break;
    case 'edit':
        newsfeed_category_table_menu::editCategory($cid[0], $menutype, $option);
        break;
    case 'save':
    case 'apply':
        saveMenu($option, $task);
        break;
}
Ejemplo n.º 4
0
$GLOBALS["addjs_modules"] .= ",sec-menu.js";
$GLOBALS["addjs_assets"] .= ",ace-editor/ace.js";
if (!isset($_GET["arg"])) {
    DrawMenuList();
} else {
    switch ($_GET["arg"]) {
        case "ajax-save":
            $id = $connection->real_escape_string($_POST["id"]);
            $container = $connection->real_escape_string($_POST["container"]);
            $type = $connection->real_escape_string($_POST["type"]);
            $title = $connection->real_escape_string($_POST["title"]);
            $json = $connection->real_escape_string($_POST["json"]);
            if ($id == "") {
                $id = uniqid();
            }
            saveMenu($id, $container, $type, $title, $json);
            break;
        case "ajax-manual-editor":
            $id = $connection->real_escape_string($_POST["id"]);
            GetEditorContent($id);
            break;
        case "ajax-delete":
            $id = $connection->real_escape_string($_POST["id"]);
            DeleteMenu($id);
            break;
        case "ajax-load-cscope-pages-datalist":
            LoadScopeDatalist($connection->real_escape_string($_POST["container"]));
            break;
        default:
            $arg = $connection->real_escape_string($_GET["arg"]);
            DrawEditGUI($arg);
Ejemplo n.º 5
0
$cid = mosGetParam($_POST, 'cid', '');
if (isset($cid[0])) {
    $cid[0] = stripslashes($cid[0]);
}
switch ($task) {
    case 'new':
        editMenu($option, '');
        break;
    case 'edit':
        if (!$menu) {
            $menu = $cid[0];
        }
        editMenu($option, $menu);
        break;
    case 'savemenu':
        saveMenu();
        break;
    case 'deleteconfirm':
        deleteconfirm($option, $cid[0]);
        break;
    case 'deletemenu':
        deleteMenu($option, $cid, $type);
        break;
    case 'copyconfirm':
        copyConfirm($option, $cid[0]);
        break;
    case 'copymenu':
        copyMenu($option, $cid, $type);
        break;
    case 'cancel':
        cancelMenu($option);