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


PHP cmsUser::isAdminCan方法代码示例

本文整理汇总了PHP中cmsUser::isAdminCan方法的典型用法代码示例。如果您正苦于以下问题:PHP cmsUser::isAdminCan方法的具体用法?PHP cmsUser::isAdminCan怎么用?PHP cmsUser::isAdminCan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在cmsUser的用法示例。


在下文中一共展示了cmsUser::isAdminCan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(); }
    
    cmsCore::c('page')->setTitle($_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') {
        cmsCore::c('db')->setFlag('cms_filters', $id, 'published', '0');
        cmsCore::halt('1');
    }

    if ($do == 'show') {
        cmsCore::c('db')->setFlag('cms_filters', $id, 'published', '1');
        cmsCore::halt('1');
    }

    if ($do == 'list') {
        $fields = array(
            array( 'title' =>  'id', 'field' => 'id', 'width' => '40' ),
            array( 'title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '250' ),
            array( 'title' => $_LANG['DESCRIPTION'], 'field' => 'description', 'width' => '' ),
            array( 'title' => $_LANG['AD_ENABLE'], 'field' => 'published', 'width' => '100' )
        );

        cpListTable('cms_filters', $fields, array());
    }
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:35,代码来源:filters.php

示例2: 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

示例3: applet_robots

function applet_robots()
{
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/robots', $adminAccess)) {
        cpAccessDenied();
    }
    cmsCore::c('page')->setTitle($_LANG['ROBOTS_TITLE']);
    cpAddPathway($_LANG['ROBOTS_TITLE']);
    $do = cmsCore::request('do', array('edit', 'save'), 'edit');
    if (!file_exists(PATH . '/robots.txt')) {
        $fp = fopen(PATH . '/robots.txt', 'w');
        fwrite($fp, str_replace(array('%domen%', '%host%'), array(str_replace(array('https://', 'http://'), '', cmsCore::c('config')->host), cmsCore::c('config')->host), file_get_contents(PATH . '/includes/default_robots.txt')));
        fclose($fp);
        chmod(PATH . '/robots.txt', 0777);
    }
    if ($do == 'save') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $data = cmsCore::request('robots', 'str');
        $fp = fopen(PATH . '/robots.txt', 'w');
        fwrite($fp, stripcslashes($data) . "\n");
        fclose($fp);
    }
    $robots = file_get_contents(PATH . '/robots.txt');
    cmsCore::c('page')->initTemplate('applets', 'robots')->assign('robots', $robots)->display();
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:28,代码来源:robots.php

示例4: cpMenu

function cpMenu($type = 'main')
{
    global $_LANG;
    global $adminAccess;
    $items = array();
    if ($type == 'main') {
        $inCore = cmsCore::getInstance();
        if (cmsUser::isAdminCan('admin/menu', $adminAccess)) {
            $items['admin/menu'] = array('class' => 'fa-list admin_menu', 'title' => $_LANG['AD_MENU'], 'items' => array('AD_MENU_POINT_ADD' => array('class' => 'fa-plus-circle admin_menu_mpa', 'link' => 'index.php?view=menu&do=add', 'title' => $_LANG['AD_MENU_POINT_ADD']), 'AD_MENU_ADD' => array('class' => 'fa-plus-circle admin_menu_ma', 'link' => 'index.php?view=menu&do=addmenu', 'title' => $_LANG['AD_MENU_ADD']), 'AD_SHOW_ALL' => array('class' => 'fa-ellipsis-h admin_menu_sa', 'link' => 'index.php?view=menu', 'title' => $_LANG['AD_SHOW_ALL'])));
        }
        if (cmsUser::isAdminCan('admin/modules', $adminAccess)) {
            $items['admin/modules'] = array('class' => 'fa-th admin_modules', 'title' => $_LANG['AD_MODULES'], 'items' => array('AD_MODULES_SETUP' => array('class' => 'fa-cube admin_modules_ms', 'link' => 'index.php?view=install&do=module', 'title' => $_LANG['AD_MODULES_SETUP']), 'AD_MODULE_ADD' => array('class' => 'fa-plus-circle admin_modules_ma', 'link' => 'index.php?view=modules&do=add', 'title' => $_LANG['AD_MODULE_ADD']), 'AD_SHOW_ALL' => array('class' => 'fa-plus-circle admin_modules_sa', 'link' => 'index.php?view=modules', 'title' => $_LANG['AD_SHOW_ALL'])));
        }
        if (cmsUser::isAdminCan('admin/content', $adminAccess)) {
            $items['admin/content'] = array('class' => 'fa-folder-open admin_content', 'title' => $_LANG['AD_ARTICLE_SITE'], 'items' => array('AD_ARTICLES' => array('class' => 'fa-file-text admin_content_a', 'link' => 'index.php?view=tree', 'title' => $_LANG['AD_ARTICLES']), 'AD_ARTICLES_ARCHIVE' => array('class' => 'fa-archive admin_content_aa', 'link' => 'index.php?view=arhive', 'title' => $_LANG['AD_ARTICLES_ARCHIVE']), 'AD_CREATE_SECTION' => array('class' => 'fa-plus-circle admin_content_cs', 'link' => 'index.php?view=cats&do=add', 'title' => $_LANG['AD_CREATE_SECTION']), 'AD_CREATE_ARTICLE' => array('class' => 'fa-plus-circle admin_content_ca', 'link' => 'index.php?view=content&do=add', 'title' => $_LANG['AD_CREATE_ARTICLE'])));
        }
        if (cmsUser::isAdminCan('admin/components', $adminAccess)) {
            $items['admin/components'] = array('class' => 'fa-cubes admin_components', 'title' => $_LANG['AD_COMPONENTS'], 'items' => array('AD_INSTALL_COMPONENTS' => array('class' => 'fa-cube admin_components_ic', 'link' => 'index.php?view=install&do=component', 'title' => $_LANG['AD_INSTALL_COMPONENTS'])));
            $components = $inCore->getAllComponents();
            $showed_count = 0;
            $total_count = count($components);
            if ($total_count) {
                foreach ($components as $com) {
                    if ($com['published'] && file_exists('components/' . $com['link'] . '/backend.php') && cmsUser::isAdminCan('admin/com_' . $com['link'], $adminAccess)) {
                        cmsCore::loadLanguage('components/' . $com['link']);
                        $items['admin/components']['items'][$com['link']] = array('class' => 'admin_components_' . $com['link'], 'icon' => '/admin/images/components/' . $com['link'] . '.png', 'link' => 'index.php?view=components&do=config&link=' . $com['link'], 'title' => isset($_LANG['COM_TITLE_' . mb_strtoupper($com['link'])]) ? $_LANG['COM_TITLE_' . mb_strtoupper($com['link'])] : $com['title']);
                    }
                }
            }
            if ($total_count != $showed_count && cmsCore::c('user')->id == 1) {
                $items['admin/components']['items']['AD_SHOW_ALL'] = array('class' => 'fa-ellipsis-h admin_components_sa', 'link' => 'index.php?view=components', 'title' => $_LANG['AD_SHOW_ALL']);
            }
        }
        if (cmsUser::isAdminCan('admin/plugins', $adminAccess)) {
            $items['admin/plugins'] = array('class' => 'fa-puzzle-piece admin_plugins', 'title' => $_LANG['AD_ADDITIONS'], 'items' => array('AD_INSTALL_PLUGINS' => array('class' => 'fa-cube admin_plugins_ip', 'link' => 'index.php?view=install&do=plugin', 'title' => $_LANG['AD_INSTALL_PLUGINS']), 'AD_PLUGINS' => array('class' => 'fa-puzzle-piece admin_plugins_p', 'link' => 'index.php?view=plugins', 'title' => $_LANG['AD_PLUGINS'])));
            if (cmsUser::isAdminCan('admin/filters', $adminAccess)) {
                $items['admin/plugins']['items']['AD_FILTERS'] = array('class' => 'fa-puzzle-piece admin_plugins_f', 'link' => 'index.php?view=filters', 'title' => $_LANG['AD_FILTERS']);
            }
        }
        if (cmsUser::isAdminCan('admin/users', $adminAccess)) {
            $items['admin/users'] = array('class' => 'fa-users admin_users', 'title' => $_LANG['AD_USERS'], 'items' => array('AD_USERS' => array('class' => 'fa-user admin_users_u', 'link' => 'index.php?view=users', 'title' => $_LANG['AD_USERS']), 'AD_BANLIST' => array('class' => 'fa-ban admin_users_b', 'link' => 'index.php?view=userbanlist', 'title' => $_LANG['AD_BANLIST']), 'AD_USERS_GROUP' => array('class' => 'fa-users admin_users_ug', 'link' => 'index.php?view=usergroups', 'title' => $_LANG['AD_USERS_GROUP']), 'AD_USER_ADD' => array('class' => 'fa-plus-circle admin_users_ua', 'link' => 'index.php?view=users&do=add', 'title' => $_LANG['AD_USER_ADD']), 'AD_CREATE_GROUP' => array('class' => 'fa-plus-circle admin_users_cg', 'link' => 'index.php?view=usergroups&do=add', 'title' => $_LANG['AD_CREATE_GROUP']), 'AD_PROFILE_SETTINGS' => array('class' => 'fa-cogs admin_users_ps', 'link' => 'index.php?view=components&do=config&link=users', 'title' => $_LANG['AD_PROFILE_SETTINGS'])));
        }
        if (cmsUser::isAdminCan('admin/config', $adminAccess)) {
            $items['admin/config'] = array('class' => 'fa-cogs admin_config', 'title' => $_LANG['AD_SETTINGS'], 'items' => array('AD_SITE_SETTING' => array('class' => 'fa-cogs admin_config_ss', 'link' => 'index.php?view=config', 'title' => $_LANG['AD_SITE_SETTING']), 'AD_TEMPLATES_SETTING' => array('class' => 'fa-columns admin_config_ts', 'link' => 'index.php?view=templates', 'title' => $_LANG['AD_TEMPLATES_SETTING']), 'AD_ROBOTS_TXT' => array('class' => 'fa-edit admin_config_rt', 'link' => 'index.php?view=robots', 'title' => robots . txt), 'AD_CHECKING_TREES' => array('class' => 'fa-sitemap admin_config_ct', 'link' => 'index.php?view=repairnested', 'title' => $_LANG['AD_CHECKING_TREES']), 'AD_CRON_MISSION' => array('class' => 'fa-clock-o admin_config_cm', 'link' => 'index.php?view=cron', 'title' => $_LANG['AD_CRON_MISSION']), 'AD_PHP_INFO' => array('class' => 'fa-info-circle admin_config_pi', 'link' => 'index.php?view=phpinfo', 'title' => $_LANG['AD_PHP_INFO']), 'AD_CHECK_SYSTEM' => array('class' => 'fa-pie-chart admin_config_cs', 'link' => 'index.php?view=checksystem', 'title' => $_LANG['AD_CHECK_SYSTEM']), 'AD_CLEAR_SYS_CACHE' => array('class' => 'fa-trash-o admin_config_csc', 'link' => 'index.php?view=clearcache', 'title' => $_LANG['AD_CLEAR_SYS_CACHE'])));
        }
    }
    if ($type == 'user') {
        $items['admin/help'] = array('class' => 'fa-question-circle admin_help', 'title' => $_LANG['AD_HELP'], 'items' => array('AD_DOCS' => array('class' => 'fa-question admin_help_d', 'link' => 'http://cmsrudi.ru/docs', 'target' => '_blank', 'title' => $_LANG['AD_DOCS']), 'AD_TICKETS' => array('class' => 'fa-ticket admin_help_t', 'link' => '/admin/index.php?view=tickets', 'title' => $_LANG['AD_TICKETS'])));
        $items['AD_OPEN_SITE'] = array('class' => 'fa-external-link admin_open_site', 'link' => '/', 'target' => '_blank', 'title' => $_LANG['AD_OPEN_SITE']);
        $items['admin/user_menu'] = array('class' => 'fa-user admin_user_menu', 'title' => cmsCore::c('db')->get_field('cms_users', 'id=' . cmsCore::c('user')->id, 'nickname'), 'items' => array('ip' => array('class' => 'fa-info-circle admin_user_menu_ip', 'link' => 'javascript:void(return false);', 'title' => 'IP ' . cmsCore::c('user')->ip), 'TEMPLATE_MY_PROFILE' => array('class' => 'fa-user admin_user_menu_tmp', 'link' => cmsUser::getProfileURL(cmsCore::c('user')->login), 'title' => $_LANG['TEMPLATE_MY_PROFILE'])));
        $new_messages = cmsCore::c('user')->getNewMsg();
        if ($new_messages['total']) {
            $items['admin/user_menu']['items']['AD_NEW_MSG'] = array('class' => 'fa-envelope-o admin_user_menu_nm', 'link' => '/users/' . cmsCore::c('user')->id . '/messages.html', 'title' => $_LANG['AD_NEW_MSG'] . ' (' . $new_messages['total'] . ')');
        }
        $items['admin/user_menu']['items']['AD_EXIT'] = array('class' => 'fa-power-off admin_exit', 'link' => '/logout', 'title' => $_LANG['AD_EXIT']);
    }
    cmsCore::c('page')->initTemplate('special', 'menu')->assign('items', $items)->display();
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:58,代码来源:cp.php

示例5: applet_templates

function applet_templates()
{
    global $adminAccess;
    global $_LANG;
    if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
        cpAccessDenied();
    }
    $do = cmsCore::request('do', array('config', 'save_config'), 'main');
    cmsCore::c('page')->setTitle($_LANG['AD_TEMPLATES_SETTING']);
    cpAddPathway($_LANG['AD_TEMPLATES_SETTING'], 'index.php?view=templates');
    if ($do == 'main') {
        cmsCore::c('page')->initTemplate('applets', 'templates')->assign('templates', cmsCore::getDirsList('/templates'))->display();
    }
    if ($do == 'config') {
        $template = cmsCore::request('template', 'str', '');
        cpAddPathway($_LANG['AD_TEMPLATE'] . ': ' . $template, 'index.php?view=templates&do=config&template=' . $template);
        if (!file_exists(PATH . '/templates/' . $template) || !file_exists(PATH . '/templates/' . $template . '/config.php')) {
            cmsCore::error404();
        }
        include PATH . '/templates/' . $template . '/config.php';
        if (function_exists('get_template_cfg_fields')) {
            $tpl_cfgs = get_template_cfg_fields();
            if (!empty($tpl_cfgs)) {
                $tpl_cfgs_val = cmsCore::getTplCfg($template);
                cmsCore::c('page')->initTemplate('applets', 'templates')->assign('template', $template)->assign('form_gen_form', cmsCore::c('form_gen')->generateForm($tpl_cfgs, $tpl_cfgs_val))->display();
            } else {
                cmsCore::addSessionMessage($_LANG['AD_TEMPLATE_NO_CONFIG'], 'error');
                cmsCore::redirectBack();
            }
        } else {
            cmsCore::addSessionMessage($_LANG['AD_TEMPLATE_CFG_ERROR'], 'error');
            cmsCore::redirectBack();
        }
    }
    if ($do == 'save_config') {
        $template = cmsCore::request('template', 'str', '');
        if (!file_exists(PATH . '/templates/' . $template) || !file_exists(PATH . '/templates/' . $template . '/config.php') || !cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        include PATH . '/templates/' . $template . '/config.php';
        if (function_exists('get_template_cfg_fields')) {
            $tpl_cfgs = get_template_cfg_fields();
            if (!empty($tpl_cfgs)) {
                $tpl_cfgs = cmsCore::c('form_gen')->requestForm($tpl_cfgs);
                cmsCore::saveTplCfg($tpl_cfgs, $template);
                cmsCore::addSessionMessage($_LANG['AD_TEMPLATE_CFG_SAVED'], 'success');
                cmsCore::redirect('/admin/index.php?view=templates');
            } else {
                cmsCore::error404();
            }
        } else {
            cmsCore::error404();
        }
    }
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:55,代码来源:templates.php

示例6: applet_clearcache

function applet_clearcache()
{
    global $adminAccess;
    global $_LANG;
    if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
        cpAccessDenied();
    }
    cmsCore::clearCache();
    cmsCore::addSessionMessage($_LANG['AD_CLEAR_CACHE_SUCCESS'], 'success');
    cmsCore::redirectBack();
}
开发者ID:vicktorwork,项目名称:cms1,代码行数:11,代码来源:clearcache.php

示例7: applet_phpinfo

function applet_phpinfo()
{
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
        cpAccessDenied();
    }
    cmsCore::c('page')->setTitle($_LANG['AD_PHP_INFO']);
    cpAddPathway($_LANG['AD_SITE_SETTING'], 'index.php?view=config');
    cpAddPathway($_LANG['AD_PHP_INFO'], 'index.php?view=phpinfo');
    ob_start();
    phpinfo();
    cmsCore::c('page')->initTemplate()->assign('phpinfo', ob_get_clean())->display();
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:14,代码来源:phpinfo.php

示例8: applet_robots

function applet_robots() {
    global $_LANG;
    global $adminAccess;
    
    if (!cmsUser::isAdminCan('admin/robots', $adminAccess)) { cpAccessDenied(); }
    
    cmsCore::c('page')->setTitle($_LANG['ROBOTS_TITLE']);

    cpAddPathway($_LANG['ROBOTS_TITLE']);

    $do = cmsCore::request('do', array('edit', 'save'), 'edit');

    if (!file_exists(PATH .'/robots.txt')) {
        $fp = fopen(PATH .'/robots.txt', 'w');
        fwrite($fp, str_replace(array('%domen%', '%host%'), array(str_replace(array('https://', 'http://'), '', cmsCore::c('config')->host), cmsCore::c('config')->host), file_get_contents(PATH .'/includes/default_robots.txt')));
        fclose ($fp);
        chmod(PATH .'/robots.txt', 0777);
    }

    if ($do == 'save') {
        if (!cmsUser::checkCsrfToken()) { cmsCore::error404(); }

        $data = cmsCore::request('robots', 'str');
        
        $fp = fopen(PATH .'/robots.txt', 'w');
        fwrite($fp, stripcslashes($data) ."\n");
        fclose ($fp);
    }

    $robots = file_get_contents(PATH .'/robots.txt');
?>
<form action="" method="post">
    <div style="width:650px;">
        <input type="hidden" name="csrf_token" value="<?php echo cmsUser::getCsrfToken(); ?>" />
        
        <div class="form-group">
            <label><?php echo $_LANG['ROBOTS_TXT_DATA']; ?></label>
            <textarea name="robots" class="form-control" style="height: 400px;"><?php echo $robots; ?></textarea>
            <div class="help-block"><?php echo $_LANG['ROBOTS_TXT_INFO']; ?></div>
        </div>
        
        <input type="hidden" name="do" value="save" />
        
        <input type="submit" class="btn btn-primary" name="save" value="<?php echo $_LANG['SAVE']; ?>" />
        <input type="button" class="btn btn-default" name="back" value="<?php echo $_LANG['CANCEL']; ?>" onclick="window.history.back();" />
    </div>
</form>
<?php
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:49,代码来源:robots.php

示例9: applet_tree

function applet_tree()
{
    $inCore = cmsCore::getInstance();
    cmsCore::loadLib('tags');
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/content', $adminAccess)) {
        cpAccessDenied();
    }
    cmsCore::c('page')->setTitle($_LANG['AD_ARTICLES']);
    cpAddPathway($_LANG['AD_ARTICLES'], 'index.php?view=tree');
    cmsCore::c('page')->addHeadJS('admin/js/content.js');
    echo '<script>';
    echo cmsPage::getLangJS('AD_NO_SELECTED_ARTICLES');
    echo cmsPage::getLangJS('AD_DELETE_SELECTED_ARTICLES');
    echo cmsPage::getLangJS('AD_PIECES');
    echo cmsPage::getLangJS('AD_CATEGORY_DELETE');
    echo cmsPage::getLangJS('AD_AND_SUB_CATS');
    echo cmsPage::getLangJS('AD_DELETE_SUB_ARTICLES');
    echo '</script>';
    $do = cmsCore::request('do', 'str', 'tree');
    if ($do == 'tree') {
        $toolmenu = array(array('icon' => 'config.gif', 'title' => $_LANG['AD_SETUP_CATEGORY'], 'link' => '?view=components&do=config&link=content'), array('icon' => 'help.gif', 'title' => $_LANG['AD_HELP'], 'link' => '?view=components&do=config&link=content'));
        cpToolMenu($toolmenu);
        $only_hidden = cmsCore::request('only_hidden', 'int', 0);
        $category_id = cmsCore::request('cat_id', 'int', 0);
        $base_uri = 'index.php?view=tree';
        $title_part = cmsCore::request('title', 'str', '');
        $def_order = $category_id ? 'con.ordering' : 'pubdate';
        $orderby = cmsCore::request('orderby', 'str', $def_order);
        $orderto = cmsCore::request('orderto', 'str', 'asc');
        $page = cmsCore::request('page', 'int', 1);
        $perpage = 20;
        if ($category_id) {
            cmsCore::m('content')->whereCatIs($category_id);
        }
        if ($title_part) {
            cmsCore::c('db')->where('LOWER(con.title) LIKE \'%' . mb_strtolower($title_part) . '%\'');
        }
        if ($only_hidden) {
            cmsCore::c('db')->where('con.published = 0');
        }
        cmsCore::c('db')->orderBy($orderby, $orderto);
        cmsCore::c('db')->limitPage($page, $perpage);
        $total = cmsCore::m('content')->getArticlesCount(false);
        cmsCore::c('page')->initTemplate('applets', 'tree')->assign('hide_cats', cmsCore::request('hide_cats', 'int', 0))->assign('only_hidden', $only_hidden)->assign('base_uri', $base_uri)->assign('category_id', $category_id)->assign('cats', cmsCore::m('content')->getCatsTree())->assign('orderto', $orderto)->assign('orderby', $orderby)->assign('title_part', $title_part)->assign('category_opt', $inCore->getListItemsNS('cms_category', $category_id))->assign('page', $page)->assign('total', $total)->assign('perpage', $perpage)->assign('pages', ceil($total / $perpage))->assign('items', cmsCore::m('content')->getArticlesList(false))->display();
    }
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:48,代码来源:tree.php

示例10: applet_phpinfo

function applet_phpinfo() {
    global $_LANG;
	global $adminAccess;
	if (!cmsUser::isAdminCan('admin/config', $adminAccess)) { cpAccessDenied(); }

	cmsCore::c('page')->setTitle($_LANG['AD_PHP_INFO']);

	cpAddPathway($_LANG['AD_SITE_SETTING'], 'index.php?view=config');
	cpAddPathway($_LANG['AD_PHP_INFO'], 'index.php?view=phpinfo');
?>
<div>
	<h3><?php echo $_LANG['AD_PHP_INFO']; ?></h3>
    <iframe src="/admin/includes/phpinfo.php" style="border:none;width:100%;height:600px" />
</div>
<?php
}
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:16,代码来源:phpinfo.php

示例11: applet_config

function applet_config()
{
    // получаем оригинальный конфиг
    $config = cmsConfig::getDefaultConfig();
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
        cpAccessDenied();
    }
    cmsCore::c('page')->setTitle($_LANG['AD_SITE_SETTING']);
    cpAddPathway($_LANG['AD_SITE_SETTING'], 'index.php?view=config');
    $do = cmsCore::request('do', 'str', 'list');
    if ($do == 'save') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $newCFG = cmsCore::getArrayFromRequest(array('scheme' => array('scheme', array('http', 'https'), ''), 'sitename' => array('sitename', 'str', ''), 'title_and_sitename' => array('title_and_sitename', 'int', 0), 'title_and_page' => array('title_and_page', 'int', 0), 'hometitle' => array('hometitle', 'str', ''), 'homecom' => array('homecom', 'str', ''), 'com_without_name_in_url' => array('com_without_name_in_url', 'str', ''), 'siteoff' => array('siteoff', 'int', 0), 'only_authorized' => array('only_authorized', 'int', 0), 'debug' => array('debug', 'int', 0), 'offtext' => array('offtext', 'str', ''), 'keywords' => array('keywords', 'str', ''), 'metadesc' => array('metadesc', 'str', ''), 'seourl' => array('seourl', 'int', 0), 'lang' => array('lang', 'str', 'ru'), 'is_change_lang' => array('is_change_lang', 'int', 0), 'sitemail' => array('sitemail', 'str', ''), 'sitemail_name' => array('sitemail_name', 'str', ''), 'wmark' => array('wmark', 'str', ''), 'template' => array('template', 'str', ''), 'admin_template' => array('admin_template', 'str', ''), 'cache' => array('cache', 'int', 0), 'cache_type' => array('cache_type', array('file', 'memcached'), ''), 'memcached_host' => array('memcached_host', 'str', ''), 'memcached_port' => array('memcached_port', 'int', 0), 'combine_css_enable' => array('combine_css_enable', 'int', 0), 'combine_css' => array('combine_css', 'html', ''), 'combine_js_enable' => array('combine_js_enable', 'int', 0), 'combine_js' => array('combine_js', 'html', ''), 'splash' => array('splash', 'int', 0), 'slight' => array('slight', 'int', 0), 'show_pw' => array('show_pw', 'int', 0), 'last_item_pw' => array('last_item_pw', 'int', 0), 'index_pw' => array('index_pw', 'int', 0), 'fastcfg' => array('fastcfg', 'int', 0), 'mailer' => array('mailer', 'str', ''), 'smtpsecure' => array('smtpsecure', 'str', ''), 'smtpauth' => array('smtpauth', 'int', 0), 'smtpuser' => array('smtpuser', 'str', $config['smtpuser']), 'smtppass' => array('smtppass', 'str', $config['smtppass']), 'smtphost' => array('smtphost', 'str', ''), 'smtpport' => array('smtpport', 'int', '25'), 'timezone' => array('timezone', 'str', $config['timezone']), 'user_stats' => array('user_stats', 'int', 0), 'seo_url_count' => array('seo_url_count', 'int', 0), 'max_pagebar_links' => array('max_pagebar_links', 'int', 0), 'allow_ip' => array('allow_ip', 'str', ''), 'iframe_enable' => array('iframe_enable', 'int', 0), 'vk_enable' => array('vk_enable', 'int', 0), 'vk_id' => array('vk_id', 'str', ''), 'vk_private_key' => array('vk_private_key', 'str', '')));
        $newCFG['sitename'] = stripslashes($newCFG['sitename']);
        $newCFG['hometitle'] = stripslashes($newCFG['hometitle']);
        $newCFG['offtext'] = htmlspecialchars($newCFG['offtext'], ENT_QUOTES);
        $newCFG['db_host'] = $config['db_host'];
        $newCFG['db_base'] = $config['db_base'];
        $newCFG['db_user'] = $config['db_user'];
        $newCFG['db_pass'] = $config['db_pass'];
        $newCFG['db_prefix'] = $config['db_prefix'];
        if (cmsConfig::saveToFile($newCFG)) {
            cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        } else {
            cmsCore::addSessionMessage($_LANG['AD_CONFIG_SITE_ERROR'], 'error');
        }
        cmsCore::clearCache();
        cmsCore::redirect('index.php?view=config');
    }
    cpCheckWritable('/includes/config/config.inc.json');
    $result = cmsCore::c('db')->query("SELECT (sum(data_length)+sum(index_length))/1024/1024 as size FROM INFORMATION_SCHEMA.TABLES WHERE table_schema = '" . $config['db_base'] . "'", true);
    if (!cmsCore::c('db')->error()) {
        $s = cmsCore::c('db')->fetch_assoc($result);
    } else {
        $s['size'] = 0;
    }
    cmsCore::c('page')->initTemplate('applets', 'config')->assign('config', $config)->assign('timezone_opt', cmsCore::getTimeZonesOptions($config['timezone']))->assign('admin_templates', cmsCore::getDirsList('/templates/admin'))->assign('templates', cmsCore::getDirsList('/templates'))->assign('tpl_info', cmsCore::c('page')->getTplInfo(cmsCore::c('page')->template))->assign('components_opt', cmsCore::getListItems('cms_components', $config['com_without_name_in_url'], 'title', 'ASC', 'internal=0', 'link'))->assign('homecom_opt', cmsCore::getListItems('cms_components', $config['homecom'], 'title', 'ASC', 'internal=0', 'link'))->assign('langs', cmsCore::getDirsList('/languages'))->assign('db_size', round($s['size'], 2))->display();
}
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:42,代码来源:config.php

示例12: applet_install

function applet_install() {
    $inCore = cmsCore::getInstance();
    global $_LANG;
    
    cmsCore::c('page')->setTitle($_LANG['AD_SETUP_EXTENSION']);

    $do = cmsCore::request('do', 'str', 'list');
    
    global $adminAccess;
    
    //-------------------------------- Модули ----------------------------------
    //----------- Список модулей готовых к установке или обновлению ------------
    if ($do == 'module') {
        if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) { cpAccessDenied(); }

      	cpAddPathway($_LANG['AD_SETUP_MODULES'], 'index.php?view=install&do=module');

        $new_modules = $inCore->getNewModules();
        $upd_modules = $inCore->getUpdatedModules();

        echo '<h3>'. $_LANG['AD_SETUP_MODULES'] .'</h3>';

        if (!$new_modules && !$upd_modules) {
            echo '<p>'. $_LANG['AD_NO_SEARCH_MODULES'] .'</p>';
            echo '<p>'. $_LANG['AD_IF_WANT_SETUP_MODULES'] .'</p>';
            echo '<p><a class="btn btn-default" href="javascript:window.history.go(-1);">'. $_LANG['BACK'] .'</a></p>';
            return;
        }

        if ($new_modules) {
            echo '<div class="panel panel-default"><div class="panel-heading">'. $_LANG['AD_SEARCH_MODULES'] .'</div><div class="panel-body">';
                modulesList($new_modules, $_LANG['AD_SETUP'], 'install_module');
            echo '</div></div>';
        }

        if ($upd_modules) {
            echo '<div class="panel panel-default"><div class="panel-heading">'. $_LANG['AD_MODULES_UPDATE'] .'</div><div class="panel-body">';
                modulesList($upd_modules, $_LANG['AD_UPDATE'], 'upgrade_module');
            echo '</div></div>';
        }

        echo '<p><a class="btn btn-default" href="javascript:window.history.go(-1);">'. $_LANG['BACK'] .'</a></p>';
    }
    
    //--------------------------- Установка модуля -----------------------------
    if ($do == 'install_module') {

        if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) { cpAccessDenied(); }

        $error = '';

        $module_id = cmsCore::request('id', 'str', '');

        if(!$module_id){ cmsCore::redirectBack(); }

        if ($inCore->loadModuleInstaller($module_id)){
            $_module = call_user_func('info_module_'.$module_id);
            //////////////////////////////////////
            $error   = call_user_func('install_module_'.$module_id);
        } else {
            $error = $_LANG['AD_MODULE_WIZARD_FAILURE'];
        }

        if ($error === true) {
            $inCore->installModule($_module, $_module['config']);
            cmsCore::addSessionMessage($_LANG['AD_MODULE'].' <strong>"'.$_module['title'].'"</strong> '.$_LANG['AD_SUCCESS'].$_LANG['AD_IS_INSTALL'], 'success');
            cmsCore::redirect('/admin/index.php?view=modules');
        } else {
            cmsCore::addSessionMessage($error , 'error');
            cmsCore::redirectBack();
        }

    }
    
    //--------------------------- Обновление модуля ----------------------------
    if ($do == 'upgrade_module') {
	if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) { cpAccessDenied(); }

        $error = '';

        $module_id = cmsCore::request('id', 'str', '');

        if(!$module_id){ cmsCore::redirectBack(); }

        if ($inCore->loadModuleInstaller($module_id)) {
            $_module = call_user_func('info_module_'.$module_id);
            if (isset($_module['link'])) {
                $_module['content'] = $_module['link'];
            }
            $error = call_user_func('upgrade_module_'.$module_id);
        } else {
            $error = $_LANG['AD_SETUP_WIZARD_FAILURE'];
        }

        if ($error === true) {
            $inCore->upgradeModule($_module, $_module['config']);
            cmsCore::addSessionMessage($_LANG['AD_MODULE'].' <strong>"'.$_module['title'].'"</strong> '.$_LANG['AD_SUCCESS'].$_LANG['AD_IS_UPDATE'], 'success');
            cmsCore::redirect('/admin/index.php?view=modules');
        } else {
            cmsCore::addSessionMessage($error , 'error');
//.........这里部分代码省略.........
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:101,代码来源:install.php

示例13: applet_usergroups

function applet_usergroups()
{
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/users', $adminAccess)) {
        cpAccessDenied();
    }
    $GLOBALS['cp_page_title'] = $_LANG['AD_USERS_GROUP'];
    cpAddPathway($_LANG['AD_USERS'], 'index.php?view=users');
    cpAddPathway($_LANG['AD_USERS_GROUP'], 'index.php?view=usergroups');
    $do = cmsCore::request('do', 'str', 'list');
    $id = cmsCore::request('id', 'int', -1);
    cmsCore::loadModel('users');
    $model = new cms_model_users();
    if ($do == 'list') {
        $toolmenu[] = array('icon' => 'usergroupadd.gif', 'title' => $_LANG['AD_CREATE_GROUP'], 'link' => '?view=usergroups&do=add');
        $toolmenu[] = array('icon' => 'edit.gif', 'title' => $_LANG['AD_EDIT_SELECTED'], 'link' => "javascript:checkSel('?view=usergroups&do=edit&multiple=1');");
        $toolmenu[] = array('icon' => 'delete.gif', 'title' => $_LANG['AD_DELETE_SELECTED'], 'link' => "javascript:if(confirm('{$_LANG['AD_REMOVE_GROUP']}')) { checkSel('?view=users&do=delete&multiple=1'); }");
        cpToolMenu($toolmenu);
        $fields[] = array('title' => 'id', 'field' => 'id', 'width' => '30');
        $fields[] = array('title' => $_LANG['TITLE'], 'field' => 'title', 'width' => '', 'link' => '?view=usergroups&do=edit&id=%id%', 'filter' => '12');
        $fields[] = array('title' => $_LANG['AD_FROM_USERS'], 'field' => 'id', 'width' => '100', 'prc' => 'getCountUsers');
        $fields[] = array('title' => $_LANG['AD_IF_ADMIN'], 'field' => 'is_admin', 'width' => '110', 'prc' => 'cpYesNo');
        $fields[] = array('title' => $_LANG['AD_ALIAS'], 'field' => 'alias', 'width' => '75', 'filter' => '12');
        $actions[] = array('title' => $_LANG['EDIT'], 'icon' => 'edit.gif', 'link' => '?view=usergroups&do=edit&id=%id%');
        $actions[] = array('title' => $_LANG['DELETE'], 'icon' => 'delete.gif', 'confirm' => $_LANG['AD_REMOVE_GROUP'], 'link' => '?view=usergroups&do=delete&id=%id%');
        cpListTable('cms_user_groups', $fields, $actions);
    }
    if ($do == 'delete') {
        if (!isset($_REQUEST['item'])) {
            if ($id >= 0) {
                $model->deleteGroup($id);
            }
        } else {
            $model->deleteGroups(cmsCore::request('item', 'array_int', array()));
        }
        cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
        cmsCore::redirect('index.php?view=usergroups');
    }
    if ($do == 'submit' || $do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $types = array('title' => array('title', 'str', ''), 'alias' => array('alias', 'str', ''), 'is_admin' => array('is_admin', 'int', 0), 'access' => array('access', 'array_str', array(), create_function('$a_list', 'return implode(\',\', $a_list);')));
        $items = cmsCore::getArrayFromRequest($types);
        if ($do == 'submit') {
            $inDB->insert('cms_user_groups', $items);
            cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
            cmsCore::redirect('index.php?view=usergroups');
        } else {
            $inDB->update('cms_user_groups', $items, $id);
            cmsCore::addSessionMessage($_LANG['AD_DO_SUCCESS'], 'success');
            if (empty($_SESSION['editlist'])) {
                cmsCore::redirect('index.php?view=usergroups');
            } else {
                cmsCore::redirect('index.php?view=usergroups&do=edit');
            }
        }
    }
    if ($do == 'add' || $do == 'edit') {
        $toolmenu[] = array('icon' => 'save.gif', 'title' => $_LANG['SAVE'], 'link' => 'javascript:document.addform.submit();');
        $toolmenu[] = array('icon' => 'cancel.gif', 'title' => $_LANG['CANCEL'], 'link' => 'javascript:history.go(-1);');
        cpToolMenu($toolmenu);
        if ($do == 'add') {
            cpAddPathway($_LANG['AD_CREATE_GROUP']);
        } else {
            if (isset($_REQUEST['multiple'])) {
                if (isset($_REQUEST['item'])) {
                    $_SESSION['editlist'] = cmsCore::request('item', 'array_int', array());
                } else {
                    cmsCore::addSessionMessage($_LANG['AD_NO_SELECT_OBJECTS'], 'error');
                    cmsCore::redirectBack();
                }
            }
            $ostatok = '';
            if (isset($_SESSION['editlist'])) {
                $item_id = array_shift($_SESSION['editlist']);
                if (sizeof($_SESSION['editlist']) == 0) {
                    unset($_SESSION['editlist']);
                } else {
                    $ostatok = '(' . $_LANG['AD_NEXT_IN'] . sizeof($_SESSION['editlist']) . ')';
                }
            } else {
                $item_id = cmsCore::request('id', 'int', 0);
            }
            $mod = $inDB->get_fields('cms_user_groups', "id = '{$item_id}'", '*');
            if (!$mod) {
                cmsCore::error404();
            }
            echo '<h3>' . $_LANG['AD_EDIT_GROUP'] . ' ' . $ostatok . '</h3>';
            cpAddPathway($_LANG['AD_EDIT_GROUP'] . ' ' . $mod['title']);
        }
        if (isset($mod['access'])) {
            $mod['access'] = str_replace(', ', ',', $mod['access']);
            $mod['access'] = explode(',', $mod['access']);
        }
        ?>
	<form id="addform" name="addform" method="post" action="index.php?view=usergroups">
        <input type="hidden" name="csrf_token" value="<?php 
//.........这里部分代码省略.........
开发者ID:vicktorwork,项目名称:cms1,代码行数:101,代码来源:usergroups.php

示例14: applet_config

function applet_config()
{
    // получаем оригинальный конфиг
    $config = cmsConfig::getDefaultConfig();
    $inPage = cmsPage::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    global $adminAccess;
    if (!cmsUser::isAdminCan('admin/config', $adminAccess)) {
        cpAccessDenied();
    }
    $GLOBALS['cp_page_title'] = $_LANG['AD_SITE_SETTING'];
    cpAddPathway($_LANG['AD_SITE_SETTING'], 'index.php?view=config');
    $do = cmsCore::request('do', 'str', 'list');
    if ($do == 'save') {
        if (!cmsCore::validateForm()) {
            cmsCore::error404();
        }
        $newCFG = array();
        $newCFG['sitename'] = stripslashes(cmsCore::request('sitename', 'str', ''));
        $newCFG['title_and_sitename'] = cmsCore::request('title_and_sitename', 'int', 0);
        $newCFG['title_and_page'] = cmsCore::request('title_and_page', 'int', 0);
        $newCFG['hometitle'] = stripslashes(cmsCore::request('hometitle', 'str', ''));
        $newCFG['homecom'] = cmsCore::request('homecom', 'str', '');
        $newCFG['siteoff'] = cmsCore::request('siteoff', 'int', 0);
        $newCFG['debug'] = cmsCore::request('debug', 'int', 0);
        $newCFG['offtext'] = htmlspecialchars(cmsCore::request('offtext', 'str', ''), ENT_QUOTES);
        $newCFG['keywords'] = cmsCore::request('keywords', 'str', '');
        $newCFG['metadesc'] = cmsCore::request('metadesc', 'str', '');
        $newCFG['seourl'] = cmsCore::request('seourl', 'int', 0);
        $newCFG['lang'] = cmsCore::request('lang', 'str', 'ru');
        $newCFG['is_change_lang'] = cmsCore::request('is_change_lang', 'int', 0);
        $newCFG['sitemail'] = cmsCore::request('sitemail', 'str', '');
        $newCFG['sitemail_name'] = cmsCore::request('sitemail_name', 'str', '');
        $newCFG['wmark'] = cmsCore::request('wmark', 'str', '');
        $newCFG['template'] = cmsCore::request('template', 'str', '');
        $newCFG['splash'] = cmsCore::request('splash', 'int', 0);
        $newCFG['slight'] = cmsCore::request('slight', 'int', 0);
        $newCFG['db_host'] = $config['db_host'];
        $newCFG['db_base'] = $config['db_base'];
        $newCFG['db_user'] = $config['db_user'];
        $newCFG['db_pass'] = $config['db_pass'];
        $newCFG['db_prefix'] = $config['db_prefix'];
        $newCFG['show_pw'] = cmsCore::request('show_pw', 'int', 0);
        $newCFG['last_item_pw'] = cmsCore::request('last_item_pw', 'int', 0);
        $newCFG['index_pw'] = cmsCore::request('index_pw', 'int', 0);
        $newCFG['fastcfg'] = cmsCore::request('fastcfg', 'int', 0);
        $newCFG['mailer'] = cmsCore::request('mailer', 'str', '');
        $newCFG['smtpsecure'] = cmsCore::request('smtpsecure', 'str', '');
        $newCFG['smtpauth'] = cmsCore::request('smtpauth', 'int', 0);
        $newCFG['smtpuser'] = cmsCore::inRequest('smtpuser') ? cmsCore::request('smtpuser', 'str', '') : $config['smtpuser'];
        $newCFG['smtppass'] = cmsCore::inRequest('smtppass') ? cmsCore::request('smtppass', 'str', '') : $config['smtppass'];
        $newCFG['smtphost'] = cmsCore::request('smtphost', 'str', '');
        $newCFG['smtpport'] = cmsCore::request('smtpport', 'int', '25');
        $newCFG['timezone'] = cmsCore::request('timezone', 'str', '');
        $newCFG['timediff'] = cmsCore::request('timediff', 'str', '');
        $newCFG['user_stats'] = cmsCore::request('user_stats', 'int', 0);
        $newCFG['allow_ip'] = cmsCore::request('allow_ip', 'str', '');
        if (cmsConfig::saveToFile($newCFG)) {
            cmsCore::addSessionMessage($_LANG['AD_CONFIG_SAVE_SUCCESS'], 'success');
        } else {
            cmsCore::addSessionMessage($_LANG['AD_CONFIG_SITE_ERROR'], 'error');
        }
        cmsCore::clearCache();
        cmsCore::redirect('index.php?view=config');
    }
    ?>
<div>

      <?php 
    cpCheckWritable('/includes/config.inc.php');
    ?>

<div id="config_tabs" class="uitabs">

  <ul id="tabs">
	  	<li><a href="#basic"><span><?php 
    echo $_LANG['AD_SITE'];
    ?>
</span></a></li>
	  	<li><a href="#home"><span><?php 
    echo $_LANG['AD_MAIN'];
    ?>
</span></a></li>
		<li><a href="#design"><span><?php 
    echo $_LANG['AD_DESIGN'];
    ?>
</span></a></li>
		<li><a href="#time"><span><?php 
    echo $_LANG['AD_TIME'];
    ?>
</span></a></li>
		<li><a href="#database"><span><?php 
    echo $_LANG['AD_DB'];
    ?>
</span></a></li>
		<li><a href="#mail"><span><?php 
    echo $_LANG['AD_POST'];
    ?>
</span></a></li>
//.........这里部分代码省略.........
开发者ID:4uva4ek,项目名称:svato,代码行数:101,代码来源:config.php

示例15: applet_install

function applet_install()
{
    $inCore = cmsCore::getInstance();
    global $_LANG;
    $GLOBALS['cp_page_title'] = $_LANG['AD_SETUP_EXTENSION'];
    $do = cmsCore::request('do', 'str', 'list');
    global $adminAccess;
    // ========================================================================== //
    if ($do == 'module') {
        if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) {
            cpAccessDenied();
        }
        cpAddPathway($_LANG['AD_SETUP_MODULES'], 'index.php?view=install&do=module');
        $new_modules = $inCore->getNewModules();
        $upd_modules = $inCore->getUpdatedModules();
        echo '<h3>' . $_LANG['AD_SETUP_MODULES'] . '</h3>';
        if (!$new_modules && !$upd_modules) {
            echo '<p>' . $_LANG['AD_NO_SEARCH_MODULES'] . '</p>';
            echo '<p>' . $_LANG['AD_IF_WANT_SETUP_MODULES'] . '</p>';
            echo '<p><a href="javascript:window.history.go(-1);">' . $_LANG['BACK'] . '</a></p>';
            return;
        }
        if ($new_modules) {
            echo '<p><strong>' . $_LANG['AD_SEARCH_MODULES'] . '</strong></p>';
            modulesList($new_modules, $_LANG['AD_SETUP'], 'install_module');
        }
        if ($upd_modules) {
            echo '<p><strong>' . $_LANG['AD_MODULES_UPDATE'] . '</strong></p>';
            modulesList($upd_modules, $_LANG['AD_UPDATE'], 'upgrade_module');
        }
        echo '<p>' . $_LANG['AD_CLICK_TO_CONTINUE_MODULE'] . '</p>';
        echo '<p><a href="javascript:window.history.go(-1);">' . $_LANG['BACK'] . '</a></p>';
    }
    // ========================================================================== //
    if ($do == 'install_module') {
        if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) {
            cpAccessDenied();
        }
        $error = '';
        $module_id = cmsCore::request('id', 'str', '');
        if (!$module_id) {
            cmsCore::redirectBack();
        }
        if ($inCore->loadModuleInstaller($module_id)) {
            $_module = call_user_func('info_module_' . $module_id);
            //////////////////////////////////////
            $error = call_user_func('install_module_' . $module_id);
        } else {
            $error = $_LANG['AD_MODULE_WIZARD_FAILURE'];
        }
        if ($error === true) {
            $inCore->installModule($_module, $_module['config']);
            cmsCore::addSessionMessage($_LANG['AD_MODULE'] . ' <strong>"' . $_module['title'] . '"</strong> ' . $_LANG['AD_SUCCESS'] . $_LANG['AD_IS_INSTALL'], 'success');
            cmsCore::redirect('/admin/index.php?view=modules');
        } else {
            cmsCore::addSessionMessage($error, 'error');
            cmsCore::redirectBack();
        }
    }
    // ========================================================================== //
    if ($do == 'upgrade_module') {
        if (!cmsUser::isAdminCan('admin/modules', $adminAccess)) {
            cpAccessDenied();
        }
        $error = '';
        $module_id = cmsCore::request('id', 'str', '');
        if (!$module_id) {
            cmsCore::redirectBack();
        }
        if ($inCore->loadModuleInstaller($module_id)) {
            $_module = call_user_func('info_module_' . $module_id);
            if (isset($_module['link'])) {
                $_module['content'] = $_module['link'];
            }
            $error = call_user_func('upgrade_module_' . $module_id);
        } else {
            $error = $_LANG['AD_SETUP_WIZARD_FAILURE'];
        }
        if ($error === true) {
            $inCore->upgradeModule($_module, $_module['config']);
            cmsCore::addSessionMessage($_LANG['AD_MODULE'] . ' <strong>"' . $_module['title'] . '"</strong> ' . $_LANG['AD_SUCCESS'] . $_LANG['AD_IS_UPDATE'], 'success');
            cmsCore::redirect('/admin/index.php?view=modules');
        } else {
            cmsCore::addSessionMessage($error, 'error');
            cmsCore::redirectBack();
        }
    }
    // ========================================================================== //
    if ($do == 'component') {
        if (!cmsUser::isAdminCan('admin/components', $adminAccess)) {
            cpAccessDenied();
        }
        cpAddPathway($_LANG['AD_SETUP_COMPONENTS'], 'index.php?view=install&do=component');
        $new_components = $inCore->getNewComponents();
        $upd_components = $inCore->getUpdatedComponents();
        echo '<h3>' . $_LANG['AD_SETUP_COMPONENTS'] . '</h3>';
        if (!$new_components && !$upd_components) {
            echo '<p>' . $_LANG['AD_NO_SEARCH_COMPONENTS'] . '</p>';
            echo '<p>' . $_LANG['AD_IF_WANT_SETUP_COMPONENTS'] . '</p>';
            ?>
//.........这里部分代码省略.........
开发者ID:vicktorwork,项目名称:cms1,代码行数:101,代码来源:install.php


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