当前位置: 首页>>代码示例>>PHP>>正文


PHP dbHide函数代码示例

本文整理汇总了PHP中dbHide函数的典型用法代码示例。如果您正苦于以下问题:PHP dbHide函数的具体用法?PHP dbHide怎么用?PHP dbHide使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了dbHide函数的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: applet_filters

function applet_filters()
{
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/plugins', $adminAccess)) {
        cpAccessDenied();
    }
    if (!cmsUser::isAdminCan('admin/filters', $adminAccess)) {
        cpAccessDenied();
    }
    $GLOBALS['cp_page_title'] = $_LANG['AD_FILTERS'];
    cpAddPathway($_LANG['AD_FILTERS'], 'index.php?view=filters');
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    if ($do == 'hide') {
        dbHide('cms_filters', $id);
        echo '1';
        exit;
    }
    if ($do == 'show') {
        dbShow('cms_filters', $id);
        echo '1';
        exit;
    }
    if ($do == 'list') {
        $fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
        $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '250');
        $fields[] = array('title' => $_LANG['DESCRIPTION'], 'field' => 'description', 'width' => '');
        $fields[] = array('title' => $_LANG['AD_ENABLE'], 'field' => 'published', 'width' => '100');
        $actions = array();
        cpListTable('cms_filters', $fields, $actions);
    }
}
开发者ID:r2git,项目名称:icms1,代码行数:33,代码来源:filters.php

示例2: dbShowList

        echo '1';
        exit;
    } else {
        dbShowList('cms_uc_items', $_REQUEST['item']);
        foreach ($_REQUEST['item'] as $k => $id) {
            dbQuery('UPDATE cms_uc_items SET on_moderate = 0 WHERE id=' . $id);
        }
        header('location:' . $_SERVER['HTTP_REFERER']);
    }
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'hide_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_uc_items', $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_uc_items', $_REQUEST['item']);
        header('location:' . $_SERVER['HTTP_REFERER']);
    }
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'submit_item') {
    $inCore->includeGraphics();
    $item = array();
    //get variables
    $item['cat_id'] = $inCore->request('cat_id', 'int', 0);
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:31,代码来源:backend.php

示例3: dbShow

if ($opt == 'show_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbShow('cms_faq_quests', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbShowList('cms_faq_quests', $_REQUEST['item']);
        cmsCore::redirectBack();
    }
}
if ($opt == 'hide_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_faq_quests', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_faq_quests', $_REQUEST['item']);
        cmsCore::redirectBack();
    }
}
if ($opt == 'submit_item') {
    if (!cmsCore::validateForm()) {
        cmsCore::error404();
    }
    $category_id = (int) $_REQUEST['category_id'];
    $published = (int) $_REQUEST['published'];
    $quest = $_REQUEST['quest'];
开发者ID:4uva4ek,项目名称:svato,代码行数:31,代码来源:backend.php

示例4: dbShow

if ($opt == 'show_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbShow('cms_board_items', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbShowList('cms_board_items', $_REQUEST['item']);
        $opt = 'list_items';
    }
}
if ($opt == 'hide_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_board_items', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_board_items', $_REQUEST['item']);
        $opt = 'list_items';
    }
}
if ($opt == 'submit_item') {
    if (!empty($_REQUEST['category_id'])) {
        $category_id = $inCore->request('category_id', 'int');
    } else {
        $category_id = 1;
    }
    if (!empty($_REQUEST['title'])) {
开发者ID:ratmir-by,项目名称:icms-calendar,代码行数:31,代码来源:backend.php

示例5: applet_content

function applet_content()
{
    $inCore = cmsCore::getInstance();
    $inUser = cmsUser::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    //check access
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/content', $adminAccess)) {
        cpAccessDenied();
    }
    $cfg = $inCore->loadComponentConfig('content');
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    $GLOBALS['cp_page_title'] = $_LANG['AD_ARTICLES'];
    cpAddPathway($_LANG['AD_ARTICLES'], 'index.php?view=tree');
    $do = cmsCore::request('do', 'str', 'add');
    $id = cmsCore::request('id', 'int', -1);
    if ($do == 'arhive_on') {
        $inDB->query("UPDATE cms_content SET is_arhive = 1 WHERE id = '{$id}'");
        cmsCore::addSessionMessage($_LANG['AD_ARTICLES_TO_ARHIVE'], 'success');
        cmsCore::redirectBack();
    }
    if ($do == 'move') {
        $item_id = cmsCore::request('id', 'int', 0);
        $cat_id = cmsCore::request('cat_id', 'int', 0);
        $dir = $_REQUEST['dir'];
        $step = 1;
        $model->moveItem($item_id, $cat_id, $dir, $step);
        echo '1';
        exit;
    }
    if ($do == 'move_to_cat') {
        $items = cmsCore::request('item', 'array_int');
        $to_cat_id = cmsCore::request('obj_id', 'int', 0);
        if ($items && $to_cat_id) {
            $last_ordering = (int) $inDB->get_field('cms_content', "category_id = '{$to_cat_id}' ORDER BY ordering DESC", 'ordering');
            foreach ($items as $item_id) {
                $article = $model->getArticle($item_id);
                if (!$article) {
                    continue;
                }
                $last_ordering++;
                $model->updateArticle($article['id'], array('category_id' => $to_cat_id, 'ordering' => $last_ordering, 'url' => $article['url'], 'title' => $inDB->escape_string($article['title']), 'id' => $article['id'], 'user_id' => $article['user_id']));
            }
            cmsCore::addSessionMessage($_LANG['AD_ARTICLES_TO'], 'success');
        }
        cmsCore::redirect('?view=tree&cat_id=' . $to_cat_id);
    }
    if ($do == 'show') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbShow('cms_content', $id);
            }
            echo '1';
            exit;
        } else {
            dbShowList('cms_content', cmsCore::request('item', 'array_int'));
            cmsCore::redirectBack();
        }
    }
    if ($do == 'hide') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbHide('cms_content', $id);
            }
            echo '1';
            exit;
        } else {
            dbHideList('cms_content', cmsCore::request('item', 'array_int'));
            cmsCore::redirectBack();
        }
    }
    if ($do == 'delete') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                $model->deleteArticle($id);
                cmsCore::addSessionMessage($_LANG['AD_ARTICLE_REMOVE'], 'success');
            }
        } else {
            $model->deleteArticles(cmsCore::request('item', 'array_int'));
            cmsCore::addSessionMessage($_LANG['AD_ARTICLES_REMOVE'], 'success');
        }
        cmsCore::redirectBack();
    }
    if ($do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        if (isset($_REQUEST['id'])) {
            $id = cmsCore::request('id', 'int', 0);
            $article['category_id'] = cmsCore::request('category_id', 'int', 1);
            $article['title'] = cmsCore::request('title', 'str');
            $article['url'] = cmsCore::request('url', 'str');
            $article['showtitle'] = cmsCore::request('showtitle', 'int', 0);
            $article['description'] = cmsCore::request('description', 'html', '');
            $article['description'] = $inDB->escape_string($article['description']);
            $article['content'] = cmsCore::request('content', 'html', '');
            $article['content'] = $inDB->escape_string($article['content']);
            $article['for_img'] = cmsCore::request('for_img', 'html', '');
//.........这里部分代码省略.........
开发者ID:vityapro,项目名称:cms,代码行数:101,代码来源:content.php

示例6: dbShow

    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbShow('cms_user_autoawards', $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbShowList('cms_user_autoawards', $_REQUEST['item']);
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirectBack();
    }
}
if ($opt == 'hide_award') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_user_autoawards', $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_user_autoawards', $_REQUEST['item']);
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirectBack();
    }
}
if ($opt == 'submit' || $opt == 'update') {
    if (!cmsCore::validateForm()) {
        cmsCore::error404();
    }
    $title = cmsCore::request('title', 'str', $_LANG['AD_AWARD']);
    $description = cmsCore::request('description', 'str', '');
开发者ID:r2git,项目名称:icms1,代码行数:31,代码来源:backend.php

示例7: applet_modules


//.........这里部分代码省略.........
            dbMoveDown('cms_modules', $id, $co);
        }
        cmsCore::redirectBack();
    }
    //============================================================================//
    //============================================================================//
    if ($do == 'saveorder') {
        if (isset($_REQUEST['ordering'])) {
            $ord = $_REQUEST['ordering'];
            $ids = $_REQUEST['ids'];
            foreach ($ord as $id => $ordering) {
                $inDB->query("UPDATE cms_modules SET ordering = '" . (int) $ordering . "' WHERE id = '" . (int) $ids[$id] . "'");
            }
            cmsCore::redirect('index.php?view=modules');
        }
    }
    //============================================================================//
    //============================================================================//
    if ($do == 'show') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbShow('cms_modules', $id);
            }
            echo '1';
            exit;
        } else {
            dbShowList('cms_modules', cmsCore::request('item', 'array_int', array()));
            cmsCore::redirectBack();
        }
    }
    if ($do == 'hide') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbHide('cms_modules', $id);
            }
            echo '1';
            exit;
        } else {
            dbHideList('cms_modules', cmsCore::request('item', 'array_int', array()));
            cmsCore::redirectBack();
        }
    }
    if ($do == 'delete') {
        if (!isset($_REQUEST['item'])) {
            $inCore->removeModule($id);
        } else {
            $inCore->removeModule(cmsCore::request('item', 'array_int', array()));
        }
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirect('index.php?view=modules');
    }
    //============================================================================//
    //============================================================================//
    if ($do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $id = cmsCore::request('id', 'int', 0);
        $name = cmsCore::request('name', 'str', '');
        $title = cmsCore::request('title', 'str', '');
        $titles = cmsCore::arrayToYaml(cmsCore::request('titles', 'array_str', array()));
        $position = cmsCore::request('position', 'str', '');
        $showtitle = cmsCore::request('showtitle', 'int', 0);
        $content = $inDB->escape_string(cmsCore::request('content', 'html', ''));
        $published = cmsCore::request('published', 'int', 0);
        $css_prefix = cmsCore::request('css_prefix', 'str', '');
开发者ID:deltas1,项目名称:icms1,代码行数:67,代码来源:modules.php

示例8: dbShow

if ($opt == 'show_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbShow('cms_faq_quests', cmsCore::request('item_id', 'int', 0));
        }
        echo '1';
        exit;
    } else {
        dbShowList('cms_faq_quests', cmsCore::request('item', 'array_int', array()));
        cmsCore::redirectBack();
    }
}
if ($opt == 'hide_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_faq_quests', cmsCore::request('item_id', 'int', 0));
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_faq_quests', cmsCore::request('item', 'array_int', array()));
        cmsCore::redirectBack();
    }
}
if ($opt == 'submit_item') {
    if (!cmsUser::checkCsrfToken()) {
        cmsCore::error404();
    }
    $category_id = cmsCore::request('category_id', 'int', 0);
    $published = cmsCore::request('published', 'int', 0);
    $quest = $inDB->escape_string(cmsCore::request('quest', 'html', ''));
开发者ID:deltas1,项目名称:icms1,代码行数:31,代码来源:backend.php

示例9: applet_plugins

function applet_plugins()
{
    global $_LANG;
    $inCore = cmsCore::getInstance();
    $GLOBALS['cp_page_title'] = $_LANG['AD_PLUGINS'];
    cpAddPathway($_LANG['AD_PLUGINS'], 'index.php?view=plugins');
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/plugins', $adminAccess)) {
        cpAccessDenied();
    }
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    // ===================================================================================== //
    if ($do == 'hide') {
        dbHide('cms_plugins', $id);
        echo '1';
        exit;
    }
    // ===================================================================================== //
    if ($do == 'show') {
        dbShow('cms_plugins', $id);
        echo '1';
        exit;
    }
    // ===================================================================================== //
    if ($do == 'list') {
        $toolmenu[] = array('icon' => 'install.gif', 'title' => $_LANG['AD_INSTALL_PLUGINS'], 'link' => '?view=install&do=plugin');
        cpToolMenu($toolmenu);
        $fields[] = array('title' => 'id', 'field' => 'id', 'width' => '20');
        $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'link' => '?view=plugins&do=config&id=%id%', 'width' => '250');
        $fields[] = array('title' => $_LANG['DESCRIPTION'], 'field' => 'description', 'width' => '');
        $fields[] = array('title' => $_LANG['AD_AUTHOR'], 'field' => 'author', 'width' => '160');
        $fields[] = array('title' => $_LANG['AD_VERSION'], 'field' => 'version', 'width' => '50');
        $fields[] = array('title' => $_LANG['AD_FOLDER'], 'field' => 'plugin', 'width' => '100');
        $fields[] = array('title' => $_LANG['AD_ENABLE'], 'field' => 'published', 'width' => '60');
        $actions[] = array('title' => $_LANG['AD_CONFIG'], 'icon' => 'config.gif', 'link' => '?view=plugins&do=config&id=%id%');
        $actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=install&do=remove_plugin&id=%id%', 'confirm' => $_LANG['AD_REMOVE_PLUGIN_FROM']);
        cpListTable('cms_plugins', $fields, $actions);
    }
    // ===================================================================================== //
    if ($do == 'save_config') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $plugin_name = cmsCore::request('plugin', 'str', 0);
        $config = cmsCore::request('config', 'array_str');
        if (!$config || !$plugin_name) {
            cmsCore::redirectBack();
        }
        $inCore->savePluginConfig($plugin_name, $config);
        cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        cmsCore::redirect('index.php?view=plugins');
    }
    if ($do == 'save_auto_config') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $plugin_name = cmsCore::request('plugin', 'str', '');
        $xml_file = PATH . '/plugins/' . $plugin_name . '/backend.xml';
        if (!file_exists($xml_file)) {
            cmsCore::error404();
        }
        $cfg = array();
        $backend = simplexml_load_file($xml_file);
        foreach ($backend->params->param as $param) {
            $name = (string) $param['name'];
            $type = (string) $param['type'];
            $default = (string) $param['default'];
            switch ($param['type']) {
                case 'number':
                    $value = cmsCore::request($name, 'int', $default);
                    break;
                case 'string':
                    $value = cmsCore::request($name, 'str', $default);
                    break;
                case 'html':
                    $value = cmsCore::badTagClear(cmsCore::request($name, 'html', $default));
                    break;
                case 'flag':
                    $value = cmsCore::request($name, 'int', 0);
                    break;
                case 'list':
                    $value = is_array($_POST[$name]) ? cmsCore::request($name, 'array_str', $default) : cmsCore::request($name, 'str', $default);
                    break;
                case 'list_function':
                    $value = cmsCore::request($name, 'str', $default);
                    break;
                case 'list_db':
                    $value = is_array($_POST[$name]) ? cmsCore::request($name, 'array_str', $default) : cmsCore::request($name, 'str', $default);
                    break;
            }
            $cfg[$name] = $value;
        }
        if (!$cfg || !$plugin_name) {
            cmsCore::redirectBack();
        }
        $inCore->savePluginConfig($plugin_name, $cfg);
        cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        cmsCore::redirect('index.php?view=plugins');
    }
//.........这里部分代码省略.........
开发者ID:deltas1,项目名称:icms1,代码行数:101,代码来源:plugins.php

示例10: array

    } else {
        $i = cmsCore::request('item', 'array_int', array());
        dbShowList('cms_uc_items', $i);
        foreach ($i as $k => $id) {
            $inDB->query('UPDATE cms_uc_items SET on_moderate = 0 WHERE id=' . $id);
        }
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirectBack();
    }
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'hide_item') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_uc_items', cmsCore::request('item_id', 'int', 0));
        }
        echo '1';
        exit;
    } else {
        dbHideList('cms_uc_items', cmsCore::request('item', 'array_int', array()));
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirectBack();
    }
}
//=================================================================================================//
//=================================================================================================//
if ($opt == 'renew_item') {
    $model->renewItem(cmsCore::request('item_id', 'int', 0));
    cmsCore::redirect('?view=components&do=config&id=' . $id . '&opt=list_items');
}
开发者ID:deltas1,项目名称:icms1,代码行数:31,代码来源:backend.php

示例11: applet_components

function applet_components()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    $inUser = cmsUser::getInstance();
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/components', $adminAccess)) {
        cpAccessDenied();
    }
    $GLOBALS['cp_page_title'] = $_LANG['AD_COMPONENTS'];
    cpAddPathway($_LANG['AD_COMPONENTS'], 'index.php?view=components');
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', 0);
    $link = cmsCore::request('link', 'str', '');
    if ($link) {
        $_REQUEST['id'] = $id = $inCore->getComponentId($link);
    }
    if ($do != 'list') {
        $com = $inCore->getComponent($id);
        if (!$com) {
            cmsCore::error404();
        }
        if (!cmsUser::isAdminCan('admin/com_' . $com['link'], $adminAccess)) {
            cpAccessDenied();
        }
    }
    if ($do == 'show') {
        dbShow('cms_components', $id);
        echo '1';
        exit;
    }
    if ($do == 'hide') {
        dbHide('cms_components', $id);
        echo '1';
        exit;
    }
    if ($do == 'config') {
        $file = PATH . '/admin/components/' . $com['link'] . '/backend.php';
        if (file_exists($file)) {
            cpAddPathway($com['title'] . ' v' . $com['version'], '?view=components&do=config&id=' . $com['id']);
            cmsCore::loadLanguage('components/' . $com['link']);
            cmsCore::loadLanguage('admin/components/' . $com['link']);
            include $file;
            return;
        } else {
            cmsCore::redirect('index.php?view=components');
        }
    }
    if ($do == 'list') {
        $toolmenu[] = array('icon' => 'install.gif', 'title' => $_LANG['AD_INSTALL_COMPONENTS'], 'link' => '?view=install&do=component');
        $toolmenu[] = array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=components');
        cpToolMenu($toolmenu);
        $fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
        $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'link' => '?view=components&do=config&id=%id%', 'width' => '');
        $fields[] = array('title' => $_LANG['AD_VERSION'], 'field' => 'version', 'width' => '60');
        $fields[] = array('title' => $_LANG['AD_ENABLE'], 'field' => 'published', 'width' => '65');
        $fields[] = array('title' => $_LANG['AD_AUTHOR'], 'field' => 'author', 'width' => '200');
        $fields[] = array('title' => $_LANG['AD_LINK'], 'field' => 'link', 'width' => '100');
        $actions[] = array('title' => $_LANG['AD_CONFIG'], 'icon' => 'config.gif', 'link' => '?view=components&do=config&id=%id%', 'condition' => 'cpComponentHasConfig');
        $actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'link' => '?view=install&do=remove_component&id=%id%', 'condition' => 'cpComponentCanRemove', 'confirm' => $_LANG['AD_DELETED_COMPONENT_FROM']);
        $where = '';
        if ($inUser->id > 1) {
            foreach ($adminAccess as $key => $value) {
                if (mb_strstr($value, 'admin/com_')) {
                    if ($where) {
                        $where .= ' OR ';
                    }
                    $value = str_replace('admin/com_', '', $value);
                    $where .= "link='{$value}'";
                }
            }
        }
        if (!$where) {
            $where = 'id>0';
        }
        cpListTable('cms_components', $fields, $actions, $where);
    }
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:79,代码来源:components.php

示例12: applet_menu

function applet_menu()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/menu', $adminAccess)) {
        cpAccessDenied();
    }
    $GLOBALS['cp_page_title'] = $_LANG['AD_MENU'];
    cpAddPathway($_LANG['AD_MENU'], 'index.php?view=menu');
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    if ($do == 'list') {
        $toolmenu[] = array('icon' => 'new.gif', 'title' => $_LANG['AD_MENU_POINT_ADD'], 'link' => '?view=menu&do=add');
        $toolmenu[] = array('icon' => 'newmenu.gif', 'title' => $_LANG['AD_MENU_ADD'], 'link' => '?view=menu&do=addmenu');
        $toolmenu[] = array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=edit&multiple=1');");
        $toolmenu[] = array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=delete&multiple=1');");
        $toolmenu[] = array('icon' => 'show.gif', 'title' => $_LANG['AD_ALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=show&multiple=1');");
        $toolmenu[] = array('icon' => 'hide.gif', 'title' => $_LANG['AD_DISALLOW_SELECTED'], 'link' => "javascript:checkSel('?view=menu&do=hide&multiple=1');");
        $toolmenu[] = array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=help&topic=menu');
        cpToolMenu($toolmenu);
        $fields[] = array('title' => 'Lt', 'field' => 'NSLeft', 'width' => '30');
        $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=menu&do=edit&id=%id%');
        $fields[] = array('title' => $_LANG['SHOW'], 'field' => 'published', 'width' => '60');
        $fields[] = array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '100');
        $fields[] = array('title' => $_LANG['AD_LINK'], 'field' => array('linktype', 'linkid', 'link'), 'width' => '240', 'prc' => 'cpMenutypeById');
        $fields[] = array('title' => $_LANG['AD_MENU'], 'field' => 'menu', 'width' => '70', 'filter' => '10', 'filterlist' => cpGetList('menu'), 'prc' => 'list_menu');
        $fields[] = array('title' => $_LANG['TEMPLATE'], 'field' => 'template', 'width' => '70', 'prc' => 'cpTemplateById');
        $actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=menu&do=edit&id=%id%');
        $actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_MENU_POINT_CONFIRM'], 'link' => '?view=menu&do=delete&id=%id%');
        cpListTable('cms_menu', $fields, $actions, 'parent_id>0', 'NSLeft, ordering');
    } else {
        $toolmenu[] = array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();');
        $toolmenu[] = array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'index.php?view=menu');
        cpToolMenu($toolmenu);
    }
    if ($do == 'move_up') {
        $inDB->moveNsCategory('cms_menu', $id, 'up');
        cmsCore::redirectBack();
    }
    if ($do == 'move_down') {
        $inDB->moveNsCategory('cms_menu', $id, 'down');
        cmsCore::redirectBack();
    }
    if ($do == 'show') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbShow('cms_menu', $id);
            }
            echo '1';
            exit;
        } else {
            dbShowList('cms_menu', $_REQUEST['item']);
            cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
            cmsCore::redirectBack();
        }
    }
    if ($do == 'hide') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                dbHide('cms_menu', $id);
            }
            echo '1';
            exit;
        } else {
            dbHideList('cms_menu', cmsCore::request('item', 'array_int', array()));
            cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
            cmsCore::redirectBack();
        }
    }
    if ($do == 'delete') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                $inDB->deleteNS('cms_menu', (int) $id);
            }
        } else {
            $items = cmsCore::request('item', 'array_int', array());
            foreach ($items as $item_id) {
                $inDB->deleteNS('cms_menu', $item_id);
            }
        }
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirectBack();
    }
    if ($do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $id = cmsCore::request('id', 'int', 0);
        if (!$id) {
            cmsCore::redirectBack();
        }
        $title = cmsCore::request('title', 'str', '');
        $menu = cmsCore::arrayToYaml(cmsCore::request('menu', 'array_str', ''));
        $linktype = cmsCore::request('mode', 'str', '');
        $linkid = cmsCore::request($linktype, 'str', '');
        $link = $inCore->getMenuLink($linktype, $linkid);
        $target = cmsCore::request('target', 'str', '');
        $published = cmsCore::request('published', 'int', 0);
//.........这里部分代码省略.........
开发者ID:vicktorwork,项目名称:cms1,代码行数:101,代码来源:menu.php

示例13: applet_plugins

function applet_plugins()
{
    global $_LANG;
    $inCore = cmsCore::getInstance();
    $GLOBALS['cp_page_title'] = $_LANG['AD_PLUGINS'];
    cpAddPathway($_LANG['AD_PLUGINS'], 'index.php?view=plugins');
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/plugins', $adminAccess)) {
        cpAccessDenied();
    }
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    // ===================================================================================== //
    if ($do == 'hide') {
        dbHide('cms_plugins', $id);
        echo '1';
        exit;
    }
    // ===================================================================================== //
    if ($do == 'show') {
        dbShow('cms_plugins', $id);
        echo '1';
        exit;
    }
    // ===================================================================================== //
    if ($do == 'list') {
        $toolmenu = array();
        $toolmenu[1]['icon'] = 'install.gif';
        $toolmenu[1]['title'] = $_LANG['AD_INSTALL_PLUGINS'];
        $toolmenu[1]['link'] = '?view=install&do=plugin';
        cpToolMenu($toolmenu);
        $plugin_id = cmsCore::request('installed', 'str', '');
        if ($plugin_id) {
            $task = cmsCore::request('task', 'str', 'install');
            if ($task == 'install' || $task == 'upgrade') {
                $plugin = $inCore->loadPlugin($plugin_id);
                $task_str = $task == 'install' ? $_LANG['AD_IS_INSTALL'] : $_LANG['AD_IS_UPDATE'];
                echo '<div style="color:green;margin-top:12px;margin-bottom:5px;">' . $_LANG['AD_PLUGIN'] . ' <strong>"' . $plugin->info['title'] . '"</strong> ' . $task_str . '. ' . $_LANG['AD_ENABLE_PLUGIN'] . '.</div>';
            }
            if ($task == 'remove') {
                echo '<div style="color:green;margin-top:12px;margin-bottom:5px;">' . $_LANG['AD_REMOVE_PLUGIN_OK'] . '.</div>';
            }
        }
        $fields = array();
        $fields[0]['title'] = 'id';
        $fields[0]['field'] = 'id';
        $fields[0]['width'] = '20';
        $fields[1]['title'] = $_LANG['TITLE'];
        $fields[1]['field'] = 'title';
        $fields[1]['width'] = '250';
        $fields[2]['title'] = $_LANG['DESCRIPTION'];
        $fields[2]['field'] = 'description';
        $fields[2]['width'] = '';
        $fields[3]['title'] = $_LANG['AD_AUTHOR'];
        $fields[3]['field'] = 'author';
        $fields[3]['width'] = '160';
        $fields[4]['title'] = $_LANG['AD_VERSION'];
        $fields[4]['field'] = 'version';
        $fields[4]['width'] = '50';
        $fields[5]['title'] = $_LANG['AD_FOLDER'];
        $fields[5]['field'] = 'plugin';
        $fields[5]['width'] = '100';
        $fields[6]['title'] = $_LANG['AD_ENABLE'];
        $fields[6]['field'] = 'published';
        $fields[6]['width'] = '60';
        $actions = array();
        $actions[0]['title'] = $_LANG['AD_CONFIG'];
        $actions[0]['icon'] = 'config.gif';
        $actions[0]['link'] = '?view=plugins&do=config&id=%id%';
        $actions[1]['title'] = $_LANG['DELETE'];
        $actions[1]['icon'] = 'delete.gif';
        $actions[1]['confirm'] = $_LANG['AD_REMOVE_PLUGIN_FROM'];
        $actions[1]['link'] = '?view=install&do=remove_plugin&id=%id%';
        cpListTable('cms_plugins', $fields, $actions);
    }
    // ===================================================================================== //
    if ($do == 'save_config') {
        if (!cmsCore::validateForm()) {
            cmsCore::error404();
        }
        $plugin_name = cmsCore::request('plugin', 'str', 0);
        $config = cmsCore::request('config', 'array_str');
        if (!$config || !$plugin_name) {
            cmsCore::redirectBack();
        }
        $inCore->savePluginConfig($plugin_name, $config);
        cmsUser::clearCsrfToken();
        cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        cmsCore::redirect('index.php?view=plugins');
    }
    // ===================================================================================== //
    if ($do == 'config') {
        $plugin_name = $inCore->getPluginById($id);
        if (!$plugin_name) {
            cmsCore::error404();
        }
        $plugin = $inCore->loadPlugin($plugin_name);
        $config = $inCore->loadPluginConfig($plugin_name);
        $GLOBALS['cp_page_title'] = $plugin->info['title'];
        cpAddPathway($plugin->info['title'], 'index.php?view=plugins&do=config&id=' . $id);
//.........这里部分代码省略.........
开发者ID:4uva4ek,项目名称:svato,代码行数:101,代码来源:plugins.php

示例14: dbShow

/* ========================================================================== */
/* ======================== МЕТРО / РАЙОНЫ ГОРОДА =========================== */
/* ========================================================================== */
if ($opt == 'show_district') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbShow('cms_geo_districts', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    }
}
if ($opt == 'hide_district') {
    if (!isset($_REQUEST['item'])) {
        if (isset($_REQUEST['item_id'])) {
            dbHide('cms_geo_districts', (int) $_REQUEST['item_id']);
        }
        echo '1';
        exit;
    }
}
if ($opt == 'districts') {
    cpAddPathway($_LANG['AD_DISTRICTS']);
    $fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
    $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'name', 'width' => '', 'link' => '?view=components&do=config&id=' . $id . '&opt=district_edit&item_id=%id%');
    $fields[] = array('title' => $_LANG['AD_COUNTRY1'], 'field' => 'country_id', 'width' => '120', 'prc' => 'cpGetCoutry');
    $fields[] = array('title' => $_LANG['AD_REGION'], 'field' => 'region_id', 'width' => '120', 'prc' => 'cpGetRegion');
    $fields[] = array('title' => $_LANG['AD_CITY'], 'field' => 'city_id', 'width' => '120', 'prc' => 'cpGetCity');
    $fields[] = array('title' => $_LANG['AD_ORDER'], 'field' => 'ordering', 'width' => '80', 'do_suffix' => '_department', 'do' => 'opt3');
    $fields[] = array('title' => $_LANG['AD_SHOW'], 'field' => 'published', 'width' => '80', 'do' => 'opt', 'do_suffix' => '_district');
    $actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=components&do=config&id=' . $id . '&opt=district_edit&item_id=%id%');
开发者ID:softsolution,项目名称:cms_geo_districts,代码行数:31,代码来源:backend.php


注:本文中的dbHide函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。