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


PHP Surfer::to_GMT方法代码示例

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


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

示例1: parse_fields

 /**
  * retrieve the content of one modified overlay
  *
  * @see overlays/overlay.php
  *
  * @param the fields as filled by the end user
  */
 function parse_fields($fields)
 {
     global $context;
     $this->attributes['voters'] = isset($fields['voters']) ? $fields['voters'] : '';
     $this->attributes['voter_list'] = isset($fields['voter_list']) ? $fields['voter_list'] : '';
     $this->attributes['end_date'] = isset($fields['end_date']) ? $fields['end_date'] : NULL_DATE;
     // adjust date from surfer time zone to UTC time zone
     if (isset($fields['end_date']) && $fields['end_date']) {
         $this->attributes['end_date'] = Surfer::to_GMT($fields['end_date']);
     }
 }
开发者ID:rair,项目名称:yacs,代码行数:18,代码来源:petition.php

示例2: parse_fields

 /**
  * retrieve the content of one modified overlay
  *
  * @see overlays/overlay.php
  *
  * @param the fields as filled by the end user
  */
 function parse_fields($fields)
 {
     // set initial status
     if (!isset($this->attributes['status'])) {
         $this->attributes['status'] = 'created';
     }
     // date and time
     $this->attributes['date_stamp'] = isset($fields['date_stamp']) ? $fields['date_stamp'] : '';
     if ($this->attributes['date_stamp'] && isset($fields['time_stamp']) && $fields['time_stamp']) {
         $this->attributes['date_stamp'] .= ' ' . $fields['time_stamp'];
     }
     // convert date and time from surfer time zone to GMT
     $this->attributes['date_stamp'] = Surfer::to_GMT($this->attributes['date_stamp']);
     // duration
     $this->attributes['duration'] = isset($fields['duration']) ? $fields['duration'] : 60;
     // enrolment
     if ($this->with_enrolment()) {
         $this->attributes['enrolment'] = isset($fields['enrolment']) ? $fields['enrolment'] : 'none';
     }
     // static messages
     $this->attributes['follow_up_message'] = isset($fields['follow_up_message']) ? $fields['follow_up_message'] : '';
     $this->attributes['induction_message'] = isset($fields['induction_message']) ? $fields['induction_message'] : '';
     $this->attributes['lobby_message'] = isset($fields['lobby_message']) ? $fields['lobby_message'] : '';
     $this->attributes['welcome_message'] = isset($fields['welcome_message']) ? $fields['welcome_message'] : '';
     // process event specific attributes
     $this->parse_event_fields($fields);
 }
开发者ID:rair,项目名称:yacs,代码行数:34,代码来源:event.php

示例3: parse_fields

 /**
  * retrieve the content of one modified overlay
  *
  * These are data saved into the piggy-backed overlay field of the hosting record.
  *
  * If change is the status affects a previous step of the process, then this is either a simple date
  * update or some steps have to be cancelled.
  *
  * Current and previous step are computed using following table:
  * - 'on-going:suspect': step 1 - creation
  * - 'cancelled:suspect': step 2 - qualification
  * - 'on-going:problem': step 2 - qualification
  * - 'cancelled:problem': step 3 - analysis
  * - 'on-going:issue': step 3 - analysis
  * - 'cancelled:issue': step 4 - resolution
  * - 'on-going:solution': step 4 - resolution
  * - 'cancelled:solution': step 5 - close
  * - 'completed:solution': step 5 - close
  *
  * @see overlays/overlay.php
  *
  * @param the fields as filled by the end user
  */
 function parse_fields($fields)
 {
     $this->attributes['color'] = isset($fields['color']) ? $fields['color'] : 'green';
     $this->attributes['owner'] = isset($fields['owner']) ? $fields['owner'] : '';
     $this->attributes['status'] = isset($fields['status']) ? $fields['status'] : 'on-going:suspect';
     $this->attributes['type'] = isset($fields['type']) ? $fields['type'] : 'incident';
     $this->attributes['create_date'] = isset($fields['create_date']) ? Surfer::to_GMT($fields['create_date']) : NULL_DATE;
     $this->attributes['qualification_date'] = isset($fields['qualification_date']) ? Surfer::to_GMT($fields['qualification_date']) : NULL_DATE;
     $this->attributes['analysis_date'] = isset($fields['analysis_date']) ? Surfer::to_GMT($fields['analysis_date']) : NULL_DATE;
     $this->attributes['resolution_date'] = isset($fields['resolution_date']) ? Surfer::to_GMT($fields['resolution_date']) : NULL_DATE;
     $this->attributes['close_date'] = isset($fields['close_date']) ? Surfer::to_GMT($fields['close_date']) : NULL_DATE;
 }
开发者ID:rair,项目名称:yacs,代码行数:35,代码来源:issue.php

示例4: elseif

}
// validate input syntax only if required
if (isset($_REQUEST['option_validate']) && $_REQUEST['option_validate'] == 'Y') {
    if (isset($_REQUEST['introduction'])) {
        xml::validate($_REQUEST['introduction']);
    }
    if (isset($_REQUEST['description'])) {
        xml::validate($_REQUEST['description']);
    }
}
// adjust dates from surfer time zone to UTC time zone
if (isset($_REQUEST['activation_date']) && $_REQUEST['activation_date']) {
    $_REQUEST['activation_date'] = Surfer::to_GMT($_REQUEST['activation_date']);
}
if (isset($_REQUEST['expiry_date']) && $_REQUEST['expiry_date']) {
    $_REQUEST['expiry_date'] = Surfer::to_GMT($_REQUEST['expiry_date']);
}
// stop crawlers
if (Surfer::is_crawler()) {
    Safe::header('Status: 401 Unauthorized', TRUE, 401);
    Logger::error(i18n::s('You are not allowed to perform this operation.'));
    // access denied
} elseif (!$permitted) {
    // anonymous users are invited to log in or to register
    if (!Surfer::is_logged()) {
        if (isset($item['id'])) {
            $link = Sections::get_url($item['id'], 'edit');
        } elseif (isset($_REQUEST['anchor'])) {
            $link = 'sections/edit.php?anchor=' . urlencode($_REQUEST['anchor']);
        } else {
            $link = 'sections/edit.php';
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:edit.php

示例5: isset

        $anchor->touch('article:update', $item['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y');
    }
    // clear the cache
    Articles::clear($item);
    // follow-up commands
    $follow_up = i18n::s('Where do you want to go now?');
    $menu = array();
    $menu = array_merge($menu, array(Articles::get_permalink($item) => i18n::s('Back to the page')));
    $menu = array_merge($menu, array('articles/review.php#expired' => i18n::s('Review queue')));
    $follow_up .= Skin::build_list($menu, 'menu_bar');
    $context['text'] .= Skin::build_block($follow_up, 'bottom');
    // new publication date
} elseif (isset($_REQUEST['action']) && $_REQUEST['action'] == 'publish') {
    // convert from surfer time zone to UTC time zone
    if (isset($_REQUEST['publish_date']) && $_REQUEST['publish_date'] > NULL_DATE) {
        $_REQUEST['publish_date'] = Surfer::to_GMT($_REQUEST['publish_date']);
    }
    // reset the publication date
    if (!isset($_REQUEST['publish_date']) || $_REQUEST['publish_date'] <= '0000-00-00') {
        $query = "UPDATE " . SQL::table_name('articles') . " SET publish_date='" . NULL_DATE . "' WHERE id = " . SQL::escape($item['id']);
        SQL::query($query);
        $context['text'] .= '<p>' . i18n::s('The publication date has been removed.') . "</p>\n";
        // update the database
    } elseif ($error = Articles::stamp($item['id'], $_REQUEST['publish_date'])) {
        Logger::error($error);
    } else {
        $context['text'] .= '<p>' . i18n::s('The publication date has been changed.') . "</p>\n";
    }
    // touch the related anchor
    if (is_object($anchor)) {
        $anchor->touch('article:update', $item['id'], isset($_REQUEST['silent']) && $_REQUEST['silent'] == 'Y');
开发者ID:rair,项目名称:yacs,代码行数:31,代码来源:stamp.php


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