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


PHP cmsUser::setCookiePublic方法代码示例

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


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

示例1: run

 public function run($ctype_id)
 {
     $content_model = cmsCore::getModel('content');
     $ctype = $content_model->getContentType($ctype_id);
     $categories = $content_model->getCategoriesTree($ctype['name'], false);
     $is_submitted = $this->request->has('submit');
     if ($is_submitted) {
         $hash = $this->request->get('hash');
         cmsUser::setCookiePublic('content_tree_path', "{$ctype_id}.1");
         $this->reorderCategoriesTree($content_model, $ctype, $categories, $hash);
         $this->redirectBack();
     }
     return cmsTemplate::getInstance()->render('content_cats_order', array('ctype' => $ctype, 'categories' => $categories));
 }
开发者ID:asphix,项目名称:icms2,代码行数:14,代码来源:content_cats_order.php

示例2: run

 public function run($id)
 {
     if (!$id) {
         cmsCore::error404();
     }
     $menu_model = cmsCore::getModel('menu');
     $menu = $menu_model->getMenu($id);
     if ($menu['is_fixed']) {
         cmsUser::addSessionMessage(LANG_CP_MENU_IS_FIXED);
         $this->redirectBack();
     }
     $menu_model->deleteMenu($id);
     cmsUser::setCookiePublic('menu_tree_path', '1.0');
     $this->redirectToAction('menu');
 }
开发者ID:asphix,项目名称:icms2,代码行数:15,代码来源:menu_delete.php

示例3: run

 public function run($ctype_id, $category_id = false)
 {
     if (!$category_id) {
         cmsCore::error404();
     }
     $content_model = cmsCore::getModel('content');
     $ctype = $content_model->getContentType($ctype_id);
     $category = $content_model->getCategory($ctype['name'], $category_id);
     $back_url = $this->request->get('back');
     if (!$back_url) {
         $back_url = href_to($this->name, 'content');
     }
     $url = href_to($ctype['name'], 'delcat', $category_id) . '?back=' . $back_url;
     $tree_path = $category['parent_id'] == 1 ? "{$ctype_id}.1" : "/{$ctype_id}.1/{$ctype_id}.{$category['parent_id']}";
     cmsUser::setCookiePublic('content_tree_path', $tree_path);
     $this->redirect($url);
 }
开发者ID:asphix,项目名称:icms2,代码行数:17,代码来源:content_cats_delete.php

示例4: run

 public function run()
 {
     $menu_model = cmsCore::getModel('menu');
     $form = $this->getForm('menu', array('add'));
     $is_submitted = $this->request->has('submit');
     $menu = $form->parse($this->request, $is_submitted);
     if ($is_submitted) {
         $errors = $form->validate($this, $menu);
         if (!$errors) {
             $menu_id = $menu_model->addMenu($menu);
             if ($menu_id) {
                 cmsUser::addSessionMessage(sprintf(LANG_CP_MENU_CREATED, $menu['title']), 'success');
             }
             cmsUser::setCookiePublic('menu_tree_path', "{$menu_id}.0");
             $this->redirectToAction('menu');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('menu_form', array('do' => 'add', 'item' => $menu, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:asphix,项目名称:icms2,代码行数:22,代码来源:menu_add.php

示例5: run

 public function run()
 {
     $form = $this->getForm('widgets_page');
     $is_submitted = $this->request->has('submit');
     $page = $form->parse($this->request, $is_submitted);
     if ($is_submitted) {
         $errors = $form->validate($this, $page);
         if (!$errors) {
             $widgets_model = cmsCore::getModel('widgets');
             $page_id = $widgets_model->addPage($page);
             if ($page_id) {
                 cmsUser::addSessionMessage(sprintf(LANG_CP_WIDGET_PAGE_CREATED, $page['title']), 'success');
                 cmsUser::setCookiePublic('widgets_tree_path', "/custom/custom.{$page_id}");
             }
             $this->redirectToAction('widgets');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('widgets_page', array('do' => 'add', 'page' => $page, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:asphix,项目名称:icms2,代码行数:22,代码来源:widgets_page_add.php

示例6: run

 public function run($id)
 {
     $menu_model = cmsCore::getModel('menu');
     $form = $this->getForm('menu', array('edit'));
     $menu = $menu_model->getMenu($id);
     if ($menu['is_fixed']) {
         $form->removeField('basic', 'name');
     }
     if ($this->request->has('submit')) {
         $new_menu = $form->parse($this->request, true);
         $errors = $form->validate($this, $new_menu);
         if (!$errors) {
             $menu_model->updateMenu($id, $new_menu);
             cmsUser::setCookiePublic('menu_tree_path', "{$id}.0");
             // обновление виджетов меню, в которых используется это меню
             if ($menu['name'] !== $new_menu['name']) {
                 $widgets_model = cmsCore::getModel('widgets');
                 $w_binds = $widgets_model->join('widgets', 'w', 'w.id = i.widget_id')->filterEqual('w.name', 'menu')->get('widgets_bind', function ($item, $model) {
                     $item['options'] = cmsModel::yamlToArray($item['options']);
                     return $item;
                 });
                 foreach ($w_binds as $w_bind) {
                     if (isset($w_bind['options']['menu']) && $w_bind['options']['menu'] === $menu['name']) {
                         $new = array('options' => $w_bind['options']);
                         $new['options']['menu'] = $new_menu['name'];
                         $widgets_model->updateWidgetBinding($w_bind['id'], $new);
                     }
                 }
             }
             $this->redirectToAction('menu');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
         $menu = $new_menu;
     }
     return $this->cms_template->render('menu_form', array('do' => 'edit', 'item' => $menu, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:Val-Git,项目名称:icms2,代码行数:38,代码来源:menu_edit.php

示例7: run

 public function run($id)
 {
     $menu_model = cmsCore::getModel('menu');
     $form = $this->getForm('menu', array('edit'));
     $is_submitted = $this->request->has('submit');
     $menu = $menu_model->getMenu($id);
     if ($menu['is_fixed']) {
         $form->removeField('basic', 'name');
     }
     if ($is_submitted) {
         $menu = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $menu);
         if (!$errors) {
             $menu_model->updateMenu($id, $menu);
             cmsUser::setCookiePublic('menu_tree_path', "{$id}.0");
             $this->redirectToAction('menu');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('menu_form', array('do' => 'edit', 'item' => $menu, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:asphix,项目名称:icms2,代码行数:23,代码来源:menu_edit.php


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