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


PHP waRequest::issetPost方法代码示例

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


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

示例1: getPreparedPost

 /**
  * Prepare for saving posted post and return it
  *
  * @return array prepared post
  *
  */
 private function getPreparedPost()
 {
     $post = array('id' => waRequest::post('post_id', null, waRequest::TYPE_INT), 'title' => substr(waRequest::post('title', '', waRequest::TYPE_STRING_TRIM), 0, 255), 'text' => waRequest::post('text'), 'blog_id' => waRequest::post('blog_id'), 'contact_id' => waRequest::post('contact_id'), 'datetime' => waRequest::post('datetime'), 'url' => waRequest::post('url', '', waRequest::TYPE_STRING_TRIM), 'draft' => waRequest::post('draft'), 'comments_allowed' => max(0, min(1, waRequest::post('comments_allowed', 0, waRequest::TYPE_INT))), 'public' => waRequest::post('public'), 'schedule_datetime' => waRequest::post('schedule_datetime'));
     $this->inline = waRequest::post('inline', false);
     if (waRequest::post('scheduled') && !empty($post['schedule_datetime'])) {
         $post['datetime'] = $post['schedule_datetime'];
     }
     if (!is_null($post['datetime'])) {
         $post['datetime'] = (array) $post['datetime'];
         if (count($post['datetime']) == 3) {
             $post['datetime'][1] = (int) $post['datetime'][1];
             $post['datetime'][2] = (int) $post['datetime'][2];
             $date_time = $post['datetime'][0] . ' ' . $post['datetime'][1] . ':' . $post['datetime'][2];
         } else {
             $date_time = implode(' ', $post['datetime']);
         }
         $post['datetime'] = $date_time;
     }
     if (waRequest::post('draft')) {
         $post['status'] = blogPostModel::STATUS_DRAFT;
         $this->operation = self::OPERATION_SAVE_DRAFT;
     } else {
         if (waRequest::post('deadline')) {
             if ($post['datetime']) {
                 $post['status'] = blogPostModel::STATUS_DEADLINE;
                 $this->operation = self::OPERATION_SET_DEADLINE;
             } else {
                 $post['status'] = blogPostModel::STATUS_DRAFT;
                 $this->operation = self::OPERATION_SAVE_DRAFT;
             }
         } else {
             if (waRequest::post('scheduled')) {
                 $post['status'] = blogPostModel::STATUS_SCHEDULED;
             } else {
                 if (waRequest::post('published')) {
                     $post['status'] = blogPostModel::STATUS_PUBLISHED;
                     $this->operation = self::OPERATION_PUBLISH;
                 } else {
                     if (waRequest::post('unpublish')) {
                         $post['status'] = blogPostModel::STATUS_DRAFT;
                         $this->operation = self::OPERATION_UNPUBLISH;
                     } else {
                         if ($post['id'] && waRequest::issetPost('delete')) {
                             $this->operation = self::OPERATION_DELETE;
                         } else {
                             if (waRequest::issetPost("schedule_cancel")) {
                                 $this->operation = self::OPERATION_CANCEL_SCHEDULE;
                             }
                         }
                     }
                 }
             }
         }
     }
     if (!isset($post['status'])) {
         if ($post['id']) {
             $post['status'] = $this->post_model->select('status')->where('id = i:id', array('id' => $post['id']))->fetchField('status');
         } else {
             $post['status'] = blogPostModel::STATUS_DRAFT;
         }
     }
     $blog_model = new blogBlogModel();
     $blog = $blog_model->getById($post['blog_id']);
     $post['blog_status'] = $blog['status'];
     $post['plugin'] = (array) waRequest::post('plugin', null);
     foreach ($post['plugin'] as $k => &$plugin_data) {
         if (!is_array($plugin_data)) {
             $plugin_data = trim($plugin_data);
         }
     }
     return $post;
 }
开发者ID:navi8602,项目名称:wa-shop-ppg,代码行数:78,代码来源:blogPostSave.controller.php


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