コード例 #1
0
<?php

BigPipe::loadClass("PageController");
BigPipe::loadClass("BigPipeResource");
class NoScriptController extends PageController
{
    const STAT_COLLECT = 1;
    const STAT_OUTPUT = 2;
    private $state = self::STAT_COLLECT;
    private $bodyHTML = null;
    private $bodyStyleLinks = array();
    public function __construct()
    {
        $this->actionChain = array('default' => false, 'collect_html_open' => array('outputOpenTag', true), 'collect_body_open' => array('startCollect', true), 'collect_block_open' => array('outputOpenTag', true), 'collect_block_close' => array('outputCloseTag'), 'collect_body_close' => array('collectBody'), 'collect_more' => array('changeState', true), 'output_head_open' => array('outputOpenTag', 'outputScriptReload', true), 'output_title_open' => array('outputOpenTag', true), 'output_title_close' => array('outputCloseTag'), 'output_head_close' => array('outputStyle', 'outputCloseTag'), 'output_body_open' => array('outputOpenTag', 'outputBody', false), 'output_body_close' => array('outputCloseTag'), 'output_html_close' => array('outputCloseTag'), 'output_more' => false);
    }
    protected function collectBody($context)
    {
        $this->bodyHTML = ob_get_clean();
    }
    //	protected function collectStyle($context){
    //		$this->bodyStyleLinks = array_merge($this->bodyStyleLinks, $context->styleLinks);
    //	}
    protected function outputStyle($context)
    {
        $event = $context->parent->getEvent('beforedisplay');
        if ($event != false) {
            $styleLinks = $event->requires;
            $styleResources = BigPipeResource::pathToResource($styleLinks, 'css');
            $styleResources = BigPipeResource::getDependResource($styleResources);
        }
        foreach ($styleResources as $resource) {
コード例 #2
0
<?php

BigPipe::loadClass("PageletEvent");
/**
 * Pagelet 节点上下文
 * 用于保存 Pagelet 的属性
 * 
 * @uses PageletEvent
 * @author Zhang Yuanwei <*****@*****.**> 
 */
class PageletContext
{
    /**
     * 空标志 
     */
    const FLG_NONE = 0;
    /**
     * 自动添加事件的标志
     * @see getEvent 
     */
    const FLG_AUTO_ADD_EVENT = 1;
    /**
     * 如果指定参数没有值则添加参数
     * @see getParam
     */
    const FLG_APPEND_PARAM = 2;
    /**
     * 标签类型 
     * 
     * @var int
     * @access public