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


PHP cmsController::saveOptions方法代码示例

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


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

示例1: actionOptions

 public function actionOptions()
 {
     if (empty($this->useDefaultOptionsAction)) {
         cmsCore::error404();
     }
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $is_submitted = $this->request->has('submit');
     $options = cmsController::loadOptions($this->name);
     if ($is_submitted) {
         $options = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('backend/options', array('options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:roman-burachenko,项目名称:icms2,代码行数:25,代码来源:backend.php

示例2: run

 public function run()
 {
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $is_submitted = $this->request->has('submit');
     $options = cmsController::loadOptions($this->name);
     $source_controllers = cmsEventsManager::hookAll('sitemap_sources');
     if (is_array($source_controllers)) {
         foreach ($source_controllers as $controller) {
             foreach ($controller['sources'] as $id => $title) {
                 $form->addField('sources', new fieldCheckbox("sources:{$controller['name']}|{$id}", array('title' => $title)));
             }
         }
     }
     if ($is_submitted) {
         $options = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('backend/options', array('options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:pin-git,项目名称:icms2,代码行数:30,代码来源:options.php

示例3: actionOptions

 public function actionOptions()
 {
     if (empty($this->useDefaultOptionsAction)) {
         cmsCore::error404();
     }
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $form = $this->addControllerSeoOptions($form);
     $options = cmsController::loadOptions($this->name);
     if ($this->request->has('submit')) {
         $options = array_merge($options, $form->parse($this->request, true));
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsUser::addSessionMessage(LANG_CP_SAVE_SUCCESS, 'success');
             cmsController::saveOptions($this->name, $options);
             $this->processCallback(__FUNCTION__, array($options));
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     $template_params = array('toolbar' => $this->getOptionsToolbar(), 'options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false);
     // если задан шаблон опций в контроллере
     if ($this->cms_template->getTemplateFileName('controllers/' . $this->name . '/backend/options', true)) {
         return $this->cms_template->render('backend/options', $template_params);
     } else {
         $default_admin_tpl = $this->cms_template->getTemplateFileName('controllers/admin/controllers_options');
         return $this->cms_template->processRender($default_admin_tpl, $template_params);
     }
 }
开发者ID:Val-Git,项目名称:icms2,代码行数:33,代码来源:backend.php

示例4: run

 public function run()
 {
     if (!$this->request->isAjax()) {
         cmsCore::error404();
     }
     $items = $this->request->get('items', array());
     if (!$items || !is_array($items)) {
         cmsCore::error404();
     }
     foreach ($items as $order_id => $block_id) {
         $options['dashboard_order'][(int) $block_id] = (int) $order_id;
     }
     cmsController::saveOptions('admin', array_merge($this->options, $options));
     $this->halt();
 }
开发者ID:Val-Git,项目名称:icms2,代码行数:15,代码来源:index_save_order.php

示例5: run

 public function run()
 {
     $form = $this->getForm('options');
     if (!$form) {
         cmsCore::error404();
     }
     $activity_model = cmsCore::getModel('activity');
     $is_submitted = $this->request->has('submit');
     $options = cmsController::loadOptions($this->name);
     if ($is_submitted) {
         $options = $form->parse($this->request, $is_submitted);
         $errors = $form->validate($this, $options);
         if (!$errors) {
             cmsController::saveOptions($this->name, $options);
             $activity_model->enableTypes($options['types']);
             $this->redirectToAction('options');
         }
         if ($errors) {
             cmsUser::addSessionMessage(LANG_FORM_ERRORS, 'error');
         }
     }
     return cmsTemplate::getInstance()->render('backend/options', array('options' => $options, 'form' => $form, 'errors' => isset($errors) ? $errors : false));
 }
开发者ID:asphix,项目名称:icms2,代码行数:23,代码来源:options.php


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