Ignore:
Timestamp:
2012/02/23 15:34:37 (14 years ago)
Author:
h_yoshimoto
Message:

#1603 #1632 プラグイン仕様変更に伴う修正

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/SC_View.php

    r21514 r21546  
    2727 
    2828    var $_smarty; 
     29     
     30    var $objPage; 
    2931 
    3032    // コンストラクタ 
     
    8991            } 
    9092        } 
     93        // 各filterをセットします. 
     94        $this->registFilter(); 
    9195        $res =  $this->_smarty->fetch($template); 
    9296        if (ADMIN_MODE == '1') { 
     
    97101        return $res; 
    98102    } 
    99  
     103     
     104    /** 
     105     * Pageオブジェクトをセットします. 
     106     * @param LC_Page_Ex $objPage  
     107     * @return void 
     108     */ 
     109    function setPage(LC_Page_Ex $objPage) { 
     110       $this->objPage = $objPage; 
     111    } 
     112     
     113    /** 
     114     * Smartyのfilterをセットします.  
     115     * @return void 
     116     */ 
     117    function registFilter() { 
     118        $this->_smarty->register_prefilter(array(&$this, 'prefilter_transforme')); 
     119        $this->_smarty->register_outputfilter(array(&$this, 'outputfilter_transforme')); 
     120    } 
     121     
     122    /** 
     123     * prefilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 
     124     * @param string $source ソース 
     125     * @param Smarty_Compiler $smarty Smartyのコンパイラクラス 
     126     * @return string $source ソース 
     127     */ 
     128    function prefilter_transforme($source, &$smarty) { 
     129        // フックポイントを実行. 
     130        $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); 
     131        $objPlugin->doAction('prefilterTransforme', array(&$source, $this->objPage)); 
     132        return $source; 
     133    } 
     134 
     135    /** 
     136     * outputfilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 
     137     * @param string $source ソース 
     138     * @param Smarty_Compiler $smarty Smartyのコンパイラクラス 
     139     * @return string $source ソース 
     140     */ 
     141    function outputfilter_transforme($source, &$smarty) { 
     142        // フックポイントを実行. 
     143        $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); 
     144        $objPlugin->doAction('outputfilterTransforme', array(&$source, $this->objPage)); 
     145        return $source; 
     146    } 
     147     
    100148    // テンプレートの処理結果を表示 
    101149    function display($template, $no_error = false) { 
Note: See TracChangeset for help on using the changeset viewer.