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


PHP Base\ActionIndex类代码示例

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


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

示例1: execute

 /**
  * Execute the action.
  */
 public function execute()
 {
     parent::execute();
     $this->setFilter();
     $this->setItems();
     $this->createXML();
 }
开发者ID:newaltcoin,项目名称:forkcms,代码行数:10,代码来源:ExportAnalyse.php

示例2: parse

 /**
  * Parse the correct messages into the template
  */
 protected function parse()
 {
     parent::parse();
     // grab the error-type from the parameters
     $errorType = $this->getParameter('type');
     // set correct headers
     switch ($errorType) {
         case 'module-not-allowed':
         case 'action-not-allowed':
             $this->statusCode = Response::HTTP_FORBIDDEN;
             break;
         case 'not-found':
             $this->statusCode = Response::HTTP_NOT_FOUND;
             break;
         default:
             $this->statusCode = Response::HTTP_BAD_REQUEST;
             break;
     }
     // querystring provided?
     if ($this->getParameter('querystring') !== null) {
         // split into file and parameters
         $chunks = explode('?', $this->getParameter('querystring'));
         // get extension
         $extension = pathinfo($chunks[0], PATHINFO_EXTENSION);
         // if the file has an extension it is a non-existing-file
         if ($extension != '' && $extension != $chunks[0]) {
             // give a nice error, so we can detect which file is missing
             throw new ExitException('File not found', 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.', Response::HTTP_NOT_FOUND);
         }
     }
     // assign the correct message into the template
     $this->tpl->assign('message', BL::err(\SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:36,代码来源:Index.php

示例3: parse

 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', (string) $this->dataGrid->getContent());
     // check if this action is allowed
     $this->tpl->assign('allowFaqAddCategory', $this->multipleCategoriesAllowed);
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:10,代码来源:Categories.php

示例4: parse

 /**
  * Parse the correct messages into the template
  */
 protected function parse()
 {
     parent::parse();
     // grab the error-type from the parameters
     $errorType = $this->getParameter('type');
     // set correct headers
     switch ($errorType) {
         case 'module-not-allowed':
         case 'action-not-allowed':
             header('HTTP/1.1 403 Forbidden');
             break;
         case 'not-found':
             header('HTTP/1.1 404 Not Found');
             break;
     }
     // querystring provided?
     if ($this->getParameter('querystring') !== null) {
         // split into file and parameters
         $chunks = explode('?', $this->getParameter('querystring'));
         // get extension
         $extension = pathinfo($chunks[0], PATHINFO_EXTENSION);
         // if the file has an extension it is a non-existing-file
         if ($extension != '' && $extension != $chunks[0]) {
             // set correct headers
             header('HTTP/1.1 404 Not Found');
             // give a nice error, so we can detect which file is missing
             echo 'Requested file (' . htmlspecialchars($this->getParameter('querystring')) . ') not found.';
             // stop script execution
             exit;
         }
     }
     // assign the correct message into the template
     $this->tpl->assign('message', BL::err(\SpoonFilter::toCamelCase(htmlspecialchars($errorType), '-')));
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:37,代码来源:Index.php

示例5: execute

 /**
  * Execute the action
  */
 public function execute()
 {
     parent::execute();
     $this->loadDataGrid();
     $this->parse();
     $this->display();
 }
开发者ID:jeroendesloovere,项目名称:fork-cms-module-instagram,代码行数:10,代码来源:Index.php

示例6: parse

 /**
  * Parse
  */
 protected function parse()
 {
     parent::parse();
     // form info
     $this->tpl->assign('name', $this->record['name']);
     $this->tpl->assign('formId', $this->record['id']);
     // sent info
     $this->tpl->assign('id', $this->data['id']);
     $this->tpl->assign('sentOn', $this->data['sent_on']);
     // init
     $data = array();
     // prepare data
     foreach ($this->data['fields'] as $field) {
         // implode arrays
         if (is_array($field['value'])) {
             $field['value'] = implode(', ', $field['value']);
         } else {
             // new lines to line breaks
             $field['value'] = nl2br($field['value']);
         }
         // add to data
         $data[] = $field;
     }
     // assign
     $this->tpl->assign('data', $data);
     $this->tpl->assign('filter', $this->filter);
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:30,代码来源:DataDetails.php

示例7: parse

 /**
  * Parse the action into the template
  */
 public function parse()
 {
     parent::parse();
     // assign the interface language ourself, because it won't be assigned automagically
     $this->tpl->assign('INTERFACE_LANGUAGE', BL::getInterfaceLanguage());
     $this->frm->parse($this->tpl);
     $this->frmForgotPassword->parse($this->tpl);
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:11,代码来源:Index.php

示例8: parse

 /**
  * Parse the dataGrids and the reports
  */
 protected function parse()
 {
     parent::parse();
     // parse dataGrids
     if (!empty($this->dataGrids)) {
         $this->tpl->assign('dataGrids', $this->dataGrids);
     }
     $this->tpl->assign('emptyDatagrid', $this->emptyDatagrid->getContent());
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:12,代码来源:Index.php

示例9: parse

 /**
  * Parse & display the page
  */
 protected function parse()
 {
     parent::parse();
     $this->tpl->assign('dataGrid', $this->dataGrid->getNumResults() != 0 ? $this->dataGrid->getContent() : false);
     // check if this action is allowed
     if (BackendAuthentication::isAllowedAction('AddCategory') && $this->multipleCategoriesAllowed) {
         $this->tpl->assign('showAgendaAddCategory', true);
     } else {
         $this->tpl->assign('showAgendaAddCategory', false);
     }
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:14,代码来源:Categories.php

示例10: execute

 /**
  * Execute the action
  *
  * @return  void
  */
 public function execute()
 {
     // call parent, this will probably add some general CSS/JS or other required files
     parent::execute();
     // load the datagrids
     $this->loadDataGrids();
     // parse the datagrids
     $this->parse();
     // display the page
     $this->display();
 }
开发者ID:bart-webleads,项目名称:fork-cms-module-slideshow,代码行数:16,代码来源:Index.php

示例11: parse

 protected function parse()
 {
     parent::parse();
     $this->form->parse($this->tpl);
     if ($this->get('fork.settings')->get($this->getModule(), 'web_property_id')) {
         $this->tpl->assign('web_property_id', $this->get('fork.settings')->get($this->getModule(), 'web_property_id'));
     }
     if ($this->get('fork.settings')->get($this->getModule(), 'profile')) {
         $this->tpl->assign('profile', $this->get('fork.settings')->get($this->getModule(), 'profile'));
     }
 }
开发者ID:bwgraves,项目名称:forkcms,代码行数:11,代码来源:Settings.php

示例12: execute

 /**
  * Execute the action
  */
 public function execute()
 {
     $this->id = $this->getParameter('product_id', 'int');
     if ($this->id !== null && BackendCatalogModel::exists($this->id)) {
         parent::execute();
         $this->getData();
         $this->loadDataGridImages();
         $this->loadDataGridFiles();
         $this->loadDataGridVideos();
         $this->parse();
         $this->display();
     } else {
         $this->redirect(BackendModel::createURLForAction('index') . '&error=non-existing');
     }
 }
开发者ID:Comsa-Veurne,项目名称:modules,代码行数:18,代码来源:Media.php

示例13: parse

 protected function parse()
 {
     parent::parse();
     // if we don't have a token anymore, redirect to the settings page
     if ($this->get('fork.settings')->get($this->getModule(), 'certificate') === null || $this->get('fork.settings')->get($this->getModule(), 'account') === null || $this->get('fork.settings')->get($this->getModule(), 'web_property_id') === null || $this->get('fork.settings')->get($this->getModule(), 'profile') === null) {
         $this->redirect(Model::createURLForAction('Settings'));
     }
     $this->header->addJS('highcharts.js', 'Core', false);
     $analytics = $this->get('analytics.connector');
     $analyticsTemplateToFunctionMap = ['page_views' => 'getPageViews', 'visitors' => 'getVisitors', 'pages_per_visit' => 'getPagesPerVisit', 'time_on_site' => 'getTimeOnSite', 'new_sessions_percentage' => 'getNewSessionsPercentage', 'bounce_rate' => 'getBounceRate', 'visitors_graph_data' => 'getVisitorsGraphData', 'source_graph_data' => 'getSourceGraphData'];
     foreach ($analyticsTemplateToFunctionMap as $templateVariableName => $functionName) {
         $this->tpl->assign($templateVariableName, $analytics->{$functionName}($this->dateRange->getStartDate(), $this->dateRange->getEndDate()));
     }
     $dataGrid = new DataGridArray($analytics->getMostVisitedPagesData($this->dateRange->getStartDate(), $this->dateRange->getEndDate()));
     $this->tpl->assign('dataGridMostViewedPages', (string) $dataGrid->getContent());
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:16,代码来源:Index.php

示例14: execute

 public function execute()
 {
     parent::execute();
     $settingsForm = new SettingsType('settings', $this->get('fork.settings'), $this->get('analytics.google_analytics_service'));
     if ($settingsForm->handle()) {
         $this->redirect(Model::createURLForAction('Settings'));
     }
     $settingsForm->parse($this->tpl);
     if ($this->get('fork.settings')->get($this->getModule(), 'web_property_id')) {
         $this->tpl->assign('web_property_id', $this->get('fork.settings')->get($this->getModule(), 'web_property_id'));
     }
     if ($this->get('fork.settings')->get($this->getModule(), 'profile')) {
         $this->tpl->assign('profile', $this->get('fork.settings')->get($this->getModule(), 'profile'));
     }
     $this->display();
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:16,代码来源:Settings.php

示例15: execute

 /**
  * Execute
  */
 public function execute()
 {
     parent::execute();
     $form = $this->createForm($this->get('mailmotor.form.settings'), new SaveSettings($this->get('fork.settings')));
     $form->handleRequest($this->get('request'));
     if (!$form->isValid()) {
         $this->tpl->assign('form', $form->createView());
         $this->parse();
         $this->display();
         return;
     }
     /** @var SaveSettings $settings */
     $settings = $form->getData();
     // The command bus will handle the saving of the settings in the database.
     $this->get('command_bus')->handle($settings);
     $this->get('event_dispatcher')->dispatch(SettingsSavedEvent::EVENT_NAME, new SettingsSavedEvent($settings));
     return $this->redirect(Model::createURLForAction('Settings', null, null, ['report' => 'saved']));
 }
开发者ID:forkcms,项目名称:forkcms,代码行数:21,代码来源:Settings.php


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