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


PHP Codes::render方法代码示例

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


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

示例1: time

 /**
  * display the content of one instance
  *
  * @see overlays/overlay.php
  *
  * @param array the hosting record
  * @return some HTML to be inserted into the resulting page
  */
 function &get_view_text($host = NULL)
 {
     global $context;
     // we may look at enrolments
     include_once $context['path_to_root'] . 'shared/enrolments.php';
     // minutes to go
     if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp'] > NULL_DATE) {
         $this->minutes_before_start = (sql::strtotime($this->attributes['date_stamp']) - time()) / 60;
     } else {
         $this->minutes_before_start = 120;
     }
     // prevent automatic start
     // minutes since the end of the event
     if (isset($this->attributes['duration']) && $this->attributes['duration']) {
         $this->minutes_since_stop = -($this->attributes['duration'] + $this->minutes_before_start);
     } else {
         $this->minutes_since_stop = -120;
     }
     // prevent automatic stop
     // tabular information
     $rows = array();
     // initialize feed-back to end-user
     $this->feed_back = array('message' => '', 'status' => array(), 'menu' => array(), 'commands' => array(), 'reload_this_page' => FALSE);
     // maybe a bare instance
     if (!isset($this->attributes['status'])) {
         $this->attributes['status'] = 'created';
     }
     // step 5 - end of the event
     if ($this->attributes['status'] == 'stopped') {
         // list enrolment for this meeting
         $query = "SELECT * FROM " . SQL::table_name('enrolments') . " WHERE anchor LIKE '" . SQL::escape($this->anchor->get_reference()) . "'";
         if ($result = SQL::query($query)) {
             // browse the list
             $items = array();
             while ($item = SQL::fetch($result)) {
                 // a user registered on this server
                 if ($item['user_id'] && ($user = Users::get($item['user_id']))) {
                     // make an url
                     $url = Users::get_permalink($user);
                     // gather information on this user
                     if (isset($user['full_name']) && $user['full_name']) {
                         $label = $user['full_name'] . ' (' . $user['nick_name'] . ')';
                     } else {
                         $label = $user['nick_name'];
                     }
                     $items[] = Skin::build_link($url, $label, 'user');
                     // we only have some e-mail address
                 } else {
                     $items[] = $item['user_email'];
                 }
             }
             // shape a compact list
             if (count($items)) {
                 $this->feed_back['status'][] = Skin::build_folded_box(i18n::s('Enrolment') . ' (' . count($items) . ')', Skin::finalize_list($items, 'compact'));
             }
         }
         // signal that the event is over
         $this->feed_back['status'][] = i18n::s('Event is over');
         // display the follow-up message
         if (isset($this->attributes['follow_up_message']) && $this->attributes['follow_up_message']) {
             $this->feed_back['message'] .= Codes::render($this->attributes['follow_up_message']);
         }
         // possible transition to state 'stopped'
     } else {
         $this->transition_to_stopped();
     }
     // step 4 - event has started
     if ($this->attributes['status'] == 'started') {
         // display the welcome message
         if (isset($this->attributes['welcome_message'])) {
             $this->feed_back['message'] .= Codes::render($this->attributes['welcome_message']);
         }
         // possible transition to state 'started'
     } else {
         $this->transition_to_started();
     }
     // step 3 - waiting for event start
     if ($this->attributes['status'] == 'lobby') {
         // display the lobby message
         if (isset($this->attributes['lobby_message'])) {
             $this->feed_back['message'] .= Codes::render($this->attributes['lobby_message']);
         }
         // possible transition to state 'lobby'
     } else {
         $this->transition_to_lobby();
     }
     // step 2 - enrolment has been opened
     if ($this->attributes['status'] == 'open') {
         // display the induction message
         if (isset($this->attributes['induction_message'])) {
             $this->feed_back['message'] .= Codes::render($this->attributes['induction_message']);
         }
//.........这里部分代码省略.........
开发者ID:rair,项目名称:yacs,代码行数:101,代码来源:event.php

示例2: get_invite_default_message

 /**
  * get invitation default message
  *
  * This is put in the invitation form.
  *
  * @see articles/invite.php
  *
  * @param string 'PUBLISH' or 'CANCEL'
  * @return string to be put in the web form
  */
 function get_invite_default_message($method = 'PUBLISH')
 {
     global $context;
     // to be displayed into the web form for this invitation
     $text = '';
     if ($value = $this->anchor->get_title()) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Topic'), Skin::build_link($context['url_to_home'] . $context['url_to_root'] . $this->anchor->get_url(), Codes::beautify_title($value))) . BR;
     }
     // dates
     if (isset($this->attributes['date_stamp']) && $this->attributes['date_stamp']) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Date'), Skin::build_date($this->attributes['date_stamp'], 'day')) . BR;
     }
     // build a link to the chairman page, if any
     if (isset($this->attributes['chairman']) && ($user = Users::get($this->attributes['chairman']))) {
         $text .= sprintf(i18n::c('%s: %s'), i18n::c('Chairman'), Users::get_link($user['full_name'], NULL, $user['id'])) . BR;
     }
     // event has been cancelled
     if ($method == 'CANCEL') {
         $text .= '<div><p>' . i18n::c('Event has been cancelled.') . '</p></div>';
     } else {
         // copy content of the introduction field, if any
         if ($value = $this->anchor->get_value('introduction')) {
             $text .= '<div>' . Codes::beautify('<p>' . $value . '</p>') . '</div>';
         }
         // copy the induction message, if any
         if (isset($this->attributes['induction_message'])) {
             $text .= '<div>' . Codes::render($this->attributes['induction_message']) . '</div>';
         }
     }
     // done
     return $text;
 }
开发者ID:rair,项目名称:yacs,代码行数:42,代码来源:day.php

示例3: beautify_introduction

 /**
  * format an introduction
  *
  * @param string raw introduction
  * @return string finalized title
  */
 public static function beautify_introduction($text)
 {
     // render codes
     $output = Codes::render($text);
     // render smileys after codes, else it will break escaped strings
     if (is_callable(array('Smileys', 'render_smileys'))) {
         $output = Smileys::render_smileys($output);
     }
     // return by reference
     return $output;
 }
开发者ID:rair,项目名称:yacs,代码行数:17,代码来源:codes.php


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