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


PHP cmsCore::clearAccess方法代码示例

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


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

示例1: applet_content


//.........这里部分代码省略.........
            $article['canrate'] = cmsCore::request('canrate', 'int', 0);
            $article['add_text'] = cmsCore::request('add_text', 'str');
            $enddate = explode('.', cmsCore::request('enddate', 'str'));
            $article['enddate'] = $enddate[2] . '-' . $enddate[1] . '-' . $enddate[0];
            $article['is_end'] = cmsCore::request('is_end', 'int', 0);
            $article['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
            $article['tags'] = cmsCore::request('tags', 'str');
            $olddate = cmsCore::request('olddate', 'str', '');
            $pubdate = cmsCore::request('pubdate', 'str', '');
            $article['user_id'] = cmsCore::request('user_id', 'int', $inUser->id);
            $article['tpl'] = cmsCore::request('tpl', 'str', 'com_content_read.tpl');
            $date = explode('.', $pubdate);
            $article['pubdate'] = $date[2] . '-' . $date[1] . '-' . $date[0] . ' ' . date('H:i');
            $autokeys = cmsCore::request('autokeys', 'int');
            switch ($autokeys) {
                case 1:
                    $article['meta_keys'] = $inCore->getKeywords($article['content']);
                    $article['meta_desc'] = $article['title'];
                    break;
                case 2:
                    $article['meta_desc'] = strip_tags($article['description']);
                    $article['meta_keys'] = $article['tags'];
                    break;
                case 3:
                    $article['meta_desc'] = cmsCore::request('meta_desc', 'str');
                    $article['meta_keys'] = cmsCore::request('meta_keys', 'str');
                    break;
            }
            $model->updateArticle($id, $article);
            if (!cmsCore::request('is_public', 'int', 0)) {
                $showfor = $_REQUEST['showfor'];
                cmsCore::setAccess($id, $showfor, 'material');
            } else {
                cmsCore::clearAccess($id, 'material');
            }
            if (isset($_SESSION['lang']) && $_SESSION['lang'] != 'ru') {
                $file = 'article' . $id . '_' . $_SESSION['lang'] . '.jpg';
            } else {
                $file = 'article' . $id . '.jpg';
            }
            //$file = 'article'.$id.'.jpg';
            if (cmsCore::request('delete_image', 'int', 0)) {
                @unlink(PATH . "/images/photos/small/{$file}");
                @unlink(PATH . "/images/photos/medium/{$file}");
            } else {
                // Загружаем класс загрузки фото
                cmsCore::loadClass('upload_photo');
                $inUploadPhoto = cmsUploadPhoto::getInstance();
                // Выставляем конфигурационные параметры
                $inUploadPhoto->upload_dir = PATH . '/images/photos/';
                $inUploadPhoto->small_size_w = $model->config['img_small_w'];
                $inUploadPhoto->medium_size_w = $model->config['img_big_w'];
                $inUploadPhoto->thumbsqr = $model->config['img_sqr'];
                $inUploadPhoto->is_watermark = $model->config['watermark'];
                $inUploadPhoto->input_name = 'picture';
                $inUploadPhoto->filename = $file;
                // Процесс загрузки фото
                $inUploadPhoto->uploadPhoto();
            }
            cmsCore::addSessionMessage($_LANG['AD_ARTICLE_SAVE'], 'success');
            if (!isset($_SESSION['editlist']) || @sizeof($_SESSION['editlist']) == 0) {
                cmsCore::redirect('?view=tree&cat_id=' . $article['category_id']);
            } else {
                cmsCore::redirect('?view=content&do=edit');
            }
        }
开发者ID:vityapro,项目名称:cms,代码行数:67,代码来源:content.php

示例2: applet_cats


//.........这里部分代码省略.........
            if (!$old) { cmsCore::error404(); } 
            
            // если сменили категорию
            if ($old['parent_id'] != $category['parent_id']) {
                // перемещаем ее в дереве
                $inCore->nestedSetsInit('cms_category')->MoveNode($category['id'], $category['parent_id']);
                // обновляем сеолинки категорий
                cmsCore::c('db')->updateNsCategorySeoLink('cms_category', $category['id'], cmsCore::m('content')->config['is_url_cyrillic']);
                // Обновляем ссылки меню на категории
                cmsCore::m('content')->updateCatMenu();
                // обновляем сеолинки всех вложенных статей
                cmsCore::m('content')->updateArticlesSeoLink($category['id']);
                cmsCore::addSessionMessage($_LANG['AD_CATEGORY_NEW_URL'], 'info');
            }

            cmsCore::c('db')->update('cms_category', $category, $category['id']);

            // если пришел запрос на обновление ссылок
            // и категория не менялась - если менялась, мы выше все обновили
            if (cmsCore::inRequest('update_seolink') && ($old['parent_id'] == $category['parent_id'])) {
                // обновляем сеолинки категорий
                cmsCore::c('db')->updateNsCategorySeoLink('cms_category', $category['id'], cmsCore::m('content')->config['is_url_cyrillic']);
                // Обновляем ссылки меню на категории
                cmsCore::m('content')->updateCatMenu();
                // обновляем сеолинки всех вложенных статей
                cmsCore::m('content')->updateArticlesSeoLink($category['id']);
                cmsCore::addSessionMessage($_LANG['AD_SECTION_AND_ARTICLES_NEW_URL'], 'info');
            }

            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = cmsCore::request('showfor', 'array_int');
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }

            cmsCore::addSessionMessage($_LANG['AD_CATEGORY_SAVED'], 'success');

            if (!isset($_SESSION['editlist']) || @sizeof($_SESSION['editlist']) == 0) {
                cmsCore::redirect('?view=tree&cat_id='. $category['id']);
            } else {
                cmsCore::redirect('?view=tree');
            }
        }
    }

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

        $category['title']       = cmsCore::request('title', 'str', $_LANG['AD_CATEGORY_UNTITLED']);
        $category['url']         = cmsCore::request('url', 'str', '');
        if (!empty($category['url'])) {
            $category['url'] = cmsCore::strToURL($category['url']);
        }
        $category['parent_id']   = cmsCore::request('parent_id', 'int');
        $category['description'] = cmsCore::request('description', 'html', '');
        $category['description'] = cmsCore::c('db')->escape_string($category['description']);
        $category['published']   = cmsCore::request('published', 'int', 0);
        $category['showdate']    = cmsCore::request('showdate', 'int', 0);
        $category['showcomm']    = cmsCore::request('showcomm', 'int', 0);
        $category['orderby']     = cmsCore::request('orderby', 'str', '');
        $category['orderto']     = cmsCore::request('orderto', 'str', '');
        $category['modgrp_id']   = cmsCore::request('modgrp_id', 'int', 0);
        $category['maxcols']     = cmsCore::request('maxcols', 'int', 0);
        $category['showtags']    = cmsCore::request('showtags', 'int', 0);
        $category['showrss']     = cmsCore::request('showrss', 'int', 0);
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:cats.php

示例3: applet_content


//.........这里部分代码省略.........
            $pubdate                = cmsCore::request('pubdate', 'str', '');

            $article['user_id']     = cmsCore::request('user_id', 'int', cmsCore::c('user')->id);

            $article['tpl']         = cmsCore::request('tpl', 'str', 'com_content_read');

            if ($olddate != $pubdate) {
                $date = explode('.', $pubdate);
                $article['pubdate'] = $date[2] .'-'. $date[1] .'-'. $date[0] .' '.  date('H:i');
            }

            $autokeys               = cmsCore::request('autokeys', 'int');

            switch($autokeys){
                case 1: $article['meta_keys'] = $inCore->getKeywords($article['content']);
                        $article['meta_desc'] = $article['title'];
                        break;

                case 2: $article['meta_desc'] = strip_tags($article['description']);
                        $article['meta_keys'] = $article['tags'];
                        break;

                case 3: $article['meta_desc'] = cmsCore::request('meta_desc', 'str');
                        $article['meta_keys'] = cmsCore::request('meta_keys', 'str');
                        break;
            }

            cmsCore::m('content')->updateArticle($id, $article);

            if (!cmsCore::request('is_public', 'int', 0)) {
                $showfor = cmsCore::request('showfor', 'array_int', array());
                cmsCore::setAccess($id, $showfor, 'material');
            } else {
                cmsCore::clearAccess($id, 'material');
            }

            cmsCore::m('content')->uploadArticeImage($id, cmsCore::request('delete_image', 'int', 0));

            cmsCore::addSessionMessage($_LANG['AD_ARTICLE_SAVE'], 'success');

            if (!isset($_SESSION['editlist']) || count($_SESSION['editlist']) == 0) {
                cmsCore::redirect('?view=tree&cat_id='.$article['category_id']);
            } else {
                cmsCore::redirect('?view=content&do=edit');
            }
        }
    }

    if ($do == 'submit') {
        if (!cmsUser::checkCsrfToken()) { cmsCore::error404(); }
        
        $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'] = cmsCore::c('db')->escape_string($article['description']);
        $article['content']     = cmsCore::request('content', 'html', '');
        $article['content']    	= cmsCore::c('db')->escape_string($article['content']);

        $article['published']   = cmsCore::request('published', 'int', 0);

        $article['showdate']    = cmsCore::request('showdate', 'int', 0);
        $article['showlatest']  = cmsCore::request('showlatest', 'int', 0);
        $article['showpath']    = cmsCore::request('showpath', 'int', 0);
        $article['comments']    = cmsCore::request('comments', 'int', 0);
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:67,代码来源:content.php

示例4: deleteArticle

 /**
  * Удаляет статью
  * @return bool
  */
 public function deleteArticle($id)
 {
     cmsCore::callEvent('DELETE_ARTICLE', $id);
     $this->inDB->delete('cms_content', "id='{$id}'", 1);
     $this->inDB->delete('cms_tags', "target='content' AND item_id='{$id}'");
     cmsCore::clearAccess($id, 'material');
     cmsActions::removeObjectLog('add_article', $id);
     @unlink(PATH . '/images/photos/small/article' . $id . '.jpg');
     @unlink(PATH . '/images/photos/medium/article' . $id . '.jpg');
     cmsCore::deleteRatings('content', $id);
     cmsCore::deleteComments('article', $id);
     translations::deleteTargetTranslation('content_content', $id);
     return true;
 }
开发者ID:deltas1,项目名称:icms1,代码行数:18,代码来源:model.php

示例5: applet_cats

function applet_cats()
{
    $inCore = cmsCore::getInstance();
    $inDB = cmsDatabase::getInstance();
    global $_LANG;
    $GLOBALS['cp_page_title'] = $_LANG['AD_ARTICLES'];
    cpAddPathway($_LANG['AD_ARTICLES'], 'index.php?view=tree');
    cmsCore::loadModel('content');
    $model = new cms_model_content();
    $do = cmsCore::request('do', 'str', 'add');
    $id = cmsCore::request('id', 'int', -1);
    define('IS_BILLING', $inCore->isComponentInstalled('billing'));
    if (IS_BILLING) {
        cmsCore::loadClass('billing');
    }
    if ($do == 'delete') {
        $is_with_content = cmsCore::inRequest('content');
        $model->deleteCategory($id, $is_with_content);
        cmsCore::addSessionMessage($is_with_content ? $_LANG['AD_CATEGORY_REMOVED'] : $_LANG['AD_CATEGORY_REMOVED_NOT_ARTICLE'], 'success');
        cmsCore::redirect('?view=tree');
    }
    if ($do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        $category['id'] = cmsCore::request('id', 'int', 0);
        $category['title'] = cmsCore::request('title', 'str', $_LANG['AD_SECTION_UNTITLED']);
        $category['parent_id'] = cmsCore::request('parent_id', 'int');
        $category['description'] = cmsCore::request('description', 'html');
        $category['description'] = $inDB->escape_string($category['description']);
        $category['published'] = cmsCore::request('published', 'int', 0);
        $category['showdate'] = cmsCore::request('showdate', 'int', 0);
        $category['showcomm'] = cmsCore::request('showcomm', 'int', 0);
        $category['orderby'] = cmsCore::request('orderby', 'str');
        $category['orderto'] = cmsCore::request('orderto', 'str');
        $category['modgrp_id'] = cmsCore::request('modgrp_id', 'int', 0);
        $category['maxcols'] = cmsCore::request('maxcols', 'int', 0);
        $category['showtags'] = cmsCore::request('showtags', 'int', 0);
        $category['showrss'] = cmsCore::request('showrss', 'int', 0);
        $category['showdesc'] = cmsCore::request('showdesc', 'int', 0);
        $category['is_public'] = cmsCore::request('is_public', 'int', 0);
        $category['url'] = cmsCore::request('url', 'str');
        $category['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
        $category['meta_desc'] = cmsCore::request('meta_desc', 'str');
        $category['meta_keys'] = cmsCore::request('meta_keys', 'str');
        if ($category['url']) {
            $category['url'] = cmsCore::strToURL($category['url'], $model->config['is_url_cyrillic']);
        }
        $category['tpl'] = cmsCore::request('tpl', 'str', 'com_content_view.tpl');
        $category['cost'] = cmsCore::request('cost', 'str', '');
        if (!is_numeric($category['cost'])) {
            $category['cost'] = '';
        }
        $album = array();
        $album['id'] = cmsCore::request('album_id', 'int', 0);
        $album['header'] = cmsCore::request('album_header', 'str', '');
        $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
        $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
        $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
        $album['max'] = cmsCore::request('album_max', 'int', 0);
        if ($album['id']) {
            $category['photoalbum'] = serialize($album);
        } else {
            $category['photoalbum'] = '';
        }
        // получаем старую категорию
        $old = $inDB->get_fields('cms_category', "id='{$category['id']}'", '*');
        if (!$old) {
            cmsCore::error404();
        }
        // если сменили категорию
        if ($old['parent_id'] != $category['parent_id']) {
            // перемещаем ее в дереве
            $inCore->nestedSetsInit('cms_category')->MoveNode($category['id'], $category['parent_id']);
            // обновляем сеолинки категорий
            $inDB->updateNsCategorySeoLink('cms_category', $category['id'], $model->config['is_url_cyrillic']);
            // Обновляем ссылки меню на категории
            $model->updateCatMenu();
            // обновляем сеолинки всех вложенных статей
            $model->updateArticlesSeoLink($category['id']);
            cmsCore::addSessionMessage($_LANG['AD_CATEGORY_NEW_URL'], 'info');
        }
        $inDB->update('cms_category', $category, $category['id']);
        // если пришел запрос на обновление ссылок
        // и категория не менялась - если менялась, мы выше все обновили
        if (cmsCore::inRequest('update_seolink') && $old['parent_id'] == $category['parent_id']) {
            // обновляем сеолинки категорий
            $inDB->updateNsCategorySeoLink('cms_category', $category['id'], $model->config['is_url_cyrillic']);
            // Обновляем ссылки меню на категории
            $model->updateCatMenu();
            // обновляем сеолинки всех вложенных статей
            $model->updateArticlesSeoLink($category['id']);
            cmsCore::addSessionMessage($_LANG['AD_SECTION_AND_ARTICLES_NEW_URL'], 'info');
        }
        if (!cmsCore::request('is_access', 'int', 0)) {
            $showfor = $_REQUEST['showfor'];
            cmsCore::setAccess($category['id'], $showfor, 'category');
        } else {
            cmsCore::clearAccess($category['id'], 'category');
        }
//.........这里部分代码省略.........
开发者ID:r2git,项目名称:icms1,代码行数:101,代码来源:cats.php

示例6: deleteArticle

    /**
     * Удаляет статью
     * @return bool
     */
    public function deleteArticle($id) {
        cmsCore::callEvent('DELETE_ARTICLE', $id);

        cmsCore::c('db')->delete('cms_content', "id='". $id ."'", 1);
        cmsCore::c('db')->delete('cms_tags', "target='content' AND item_id='". $id ."'");
        cmsCore::clearAccess($id, 'material');

        cmsActions::removeObjectLog('add_article', $id);

        @unlink(PATH .'/images/content/medium/'. ceil($id/100) .'/article'. $id .'.jpg');
        @unlink(PATH .'/images/content/small/'. ceil($id/100) .'/article'. $id .'.jpg');
        
        cmsCore::deleteUploadImages($id, '', 'content');
        cmsCore::deleteRatings('content', $id);
        cmsCore::deleteComments('article', $id);

        return true;
    }
开发者ID:Acsac,项目名称:CMS-RuDi,代码行数:22,代码来源:model.php

示例7: applet_cats


//.........这里部分代码省略.........
        // получаем старую категорию
        $old = $inDB->get_fields('cms_category', "id='{$category['id']}'", '*');
        if (!$old) {
            cmsCore::error404();
        }
        // если сменили категорию
        if ($old['parent_id'] != $category['parent_id']) {
            // перемещаем ее в дереве
            $inCore->nestedSetsInit('cms_category')->MoveNode($category['id'], $category['parent_id']);
            // обновляем сеолинки категорий
            $inDB->updateNsCategorySeoLink('cms_category', $category['id'], $model->config['is_url_cyrillic']);
            // Обновляем ссылки меню на категории
            $model->updateCatMenu();
            // обновляем сеолинки всех вложенных статей
            $model->updateArticlesSeoLink($category['id']);
            cmsCore::addSessionMessage($_LANG['AD_CATEGORY_NEW_URL'], 'info');
        }
        $inDB->update('cms_category', $category, $category['id']);
        // если пришел запрос на обновление ссылок
        // и категория не менялась - если менялась, мы выше все обновили
        if (cmsCore::inRequest('update_seolink') && $old['parent_id'] == $category['parent_id']) {
            // обновляем сеолинки категорий
            $inDB->updateNsCategorySeoLink('cms_category', $category['id'], $model->config['is_url_cyrillic']);
            // Обновляем ссылки меню на категории
            $model->updateCatMenu();
            // обновляем сеолинки всех вложенных статей
            $model->updateArticlesSeoLink($category['id']);
            cmsCore::addSessionMessage($_LANG['AD_SECTION_AND_ARTICLES_NEW_URL'], 'info');
        }
        if (!cmsCore::request('is_access', 'int', 0)) {
            $showfor = $_REQUEST['showfor'];
            cmsCore::setAccess($category['id'], $showfor, 'category');
        } else {
            cmsCore::clearAccess($category['id'], 'category');
        }
        if (isset($_SESSION['lang']) && $_SESSION['lang'] != 'ru') {
            $file = 'cat_article' . $category['id'] . '_' . $_SESSION['lang'] . '.jpg';
        } else {
            $file = 'cat_article' . $category['id'] . '.jpg';
        }
        // работа с файлами!
        //$file = 'cat_article'.$category['id'].'.jpg';
        if (cmsCore::request('delete_image', 'int', 0)) {
            @unlink(PATH . "/images/photos/small/{$file}");
            @unlink(PATH . "/images/photos/medium/{$file}");
        } else {
            //подгружаем параметры фото
            $small_size_w = cmsCore::request('img_small_w', 'str', '');
            $medium_size_w = cmsCore::request('img_big_w', 'str', '');
            $thumbsqr = cmsCore::request('img_sqr', 'str', '');
            // Загружаем класс загрузки фото
            cmsCore::loadClass('upload_photo');
            $inUploadPhoto = cmsUploadPhoto::getInstance();
            // Выставляем конфигурационные параметры
            $inUploadPhoto->upload_dir = PATH . '/images/photos/';
            $inUploadPhoto->small_size_w = $small_size_w;
            $inUploadPhoto->medium_size_w = $medium_size_w;
            $inUploadPhoto->thumbsqr = $thumbsqr;
            $inUploadPhoto->is_watermark = $model->config['watermark'];
            $inUploadPhoto->input_name = 'picture';
            $inUploadPhoto->filename = $file;
            // Процесс загрузки фото
            $inUploadPhoto->uploadPhoto();
            //var_dump($inUploadPhoto);
        }
        cmsCore::addSessionMessage($_LANG['AD_CATEGORY_SAVED'], 'success');
开发者ID:vityapro,项目名称:cms,代码行数:67,代码来源:cats.php

示例8: applet_cats

function applet_cats()
{
    $inCore = cmsCore::getInstance();
    global $_LANG;
    cmsCore::c('page')->setTitle($_LANG['AD_ARTICLES']);
    cpAddPathway($_LANG['AD_ARTICLES'], 'index.php?view=tree');
    $do = cmsCore::request('do', 'str', 'add');
    $id = cmsCore::request('id', 'int', -1);
    define('IS_BILLING', $inCore->isComponentInstalled('billing'));
    if (IS_BILLING) {
        cmsCore::loadClass('billing');
    }
    if ($do == 'delete') {
        $is_with_content = cmsCore::inRequest('content');
        cmsCore::m('content')->deleteCategory($id, $is_with_content);
        cmsCore::addSessionMessage($is_with_content ? $_LANG['AD_CATEGORY_REMOVED'] : $_LANG['AD_CATEGORY_REMOVED_NOT_ARTICLE'], 'success');
        cmsCore::redirect('?view=tree');
    }
    if ($do == 'update') {
        if (!cmsUser::checkCsrfToken()) {
            cmsCore::error404();
        }
        if (cmsCore::inRequest('id')) {
            $category['id'] = cmsCore::request('id', 'int', 0);
            $category['title'] = cmsCore::request('title', 'str', $_LANG['AD_SECTION_UNTITLED']);
            $category['parent_id'] = cmsCore::request('parent_id', 'int');
            $category['description'] = cmsCore::request('description', 'html', '');
            $category['description'] = cmsCore::c('db')->escape_string($category['description']);
            $category['published'] = cmsCore::request('published', 'int', 0);
            $category['showdate'] = cmsCore::request('showdate', 'int', 0);
            $category['showcomm'] = cmsCore::request('showcomm', 'int', 0);
            $category['orderby'] = cmsCore::request('orderby', 'str', '');
            $category['orderto'] = cmsCore::request('orderto', 'str', '');
            $category['modgrp_id'] = cmsCore::request('modgrp_id', 'int', 0);
            $category['maxcols'] = cmsCore::request('maxcols', 'int', 0);
            $category['showtags'] = cmsCore::request('showtags', 'int', 0);
            $category['showrss'] = cmsCore::request('showrss', 'int', 0);
            $category['showdesc'] = cmsCore::request('showdesc', 'int', 0);
            $category['is_public'] = cmsCore::request('is_public', 'int', 0);
            $category['url'] = cmsCore::request('url', 'str', '');
            $category['pagetitle'] = cmsCore::request('pagetitle', 'str', '');
            $category['meta_desc'] = cmsCore::request('meta_desc', 'str', '');
            $category['meta_keys'] = cmsCore::request('meta_keys', 'str', '');
            if (!empty($category['url'])) {
                $category['url'] = cmsCore::strToURL($category['url'], cmsCore::m('content')->config['is_url_cyrillic']);
            }
            $category['tpl'] = cmsCore::request('tpl', 'str', 'com_content_view');
            $category['cost'] = cmsCore::request('cost', 'str', '');
            if (!is_numeric($category['cost'])) {
                $category['cost'] = '';
            }
            $album = array();
            $album['id'] = cmsCore::request('album_id', 'int', 0);
            $album['header'] = cmsCore::request('album_header', 'str', '');
            $album['orderby'] = cmsCore::request('album_orderby', 'str', '');
            $album['orderto'] = cmsCore::request('album_orderto', 'str', '');
            $album['maxcols'] = cmsCore::request('album_maxcols', 'int', 0);
            $album['max'] = cmsCore::request('album_max', 'int', 0);
            if ($album['id']) {
                $category['photoalbum'] = serialize($album);
            } else {
                $category['photoalbum'] = '';
            }
            // получаем старую категорию
            $old = cmsCore::c('db')->get_fields('cms_category', "id='" . $category['id'] . "'", '*');
            if (!$old) {
                cmsCore::error404();
            }
            // если сменили категорию
            if ($old['parent_id'] != $category['parent_id']) {
                // перемещаем ее в дереве
                $inCore->nestedSetsInit('cms_category')->MoveNode($category['id'], $category['parent_id']);
                // обновляем сеолинки категорий
                cmsCore::c('db')->updateNsCategorySeoLink('cms_category', $category['id'], cmsCore::m('content')->config['is_url_cyrillic']);
                // Обновляем ссылки меню на категории
                cmsCore::m('content')->updateCatMenu();
                // обновляем сеолинки всех вложенных статей
                cmsCore::m('content')->updateArticlesSeoLink($category['id']);
                cmsCore::addSessionMessage($_LANG['AD_CATEGORY_NEW_URL'], 'info');
            }
            cmsCore::c('db')->update('cms_category', $category, $category['id']);
            // если пришел запрос на обновление ссылок
            // и категория не менялась - если менялась, мы выше все обновили
            if (cmsCore::inRequest('update_seolink') && $old['parent_id'] == $category['parent_id']) {
                // обновляем сеолинки категорий
                cmsCore::c('db')->updateNsCategorySeoLink('cms_category', $category['id'], cmsCore::m('content')->config['is_url_cyrillic']);
                // Обновляем ссылки меню на категории
                cmsCore::m('content')->updateCatMenu();
                // обновляем сеолинки всех вложенных статей
                cmsCore::m('content')->updateArticlesSeoLink($category['id']);
                cmsCore::addSessionMessage($_LANG['AD_SECTION_AND_ARTICLES_NEW_URL'], 'info');
            }
            if (!cmsCore::request('is_access', 'int', 0)) {
                $showfor = cmsCore::request('showfor', 'array_int');
                cmsCore::setAccess($category['id'], $showfor, 'category');
            } else {
                cmsCore::clearAccess($category['id'], 'category');
            }
            cmsCore::addSessionMessage($_LANG['AD_CATEGORY_SAVED'], 'success');
            if (!isset($_SESSION['editlist']) || @sizeof($_SESSION['editlist']) == 0) {
//.........这里部分代码省略.........
开发者ID:CMS-RuDi,项目名称:CMS-RuDi,代码行数:101,代码来源:cats.php


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