Ignore:
Timestamp:
2012/02/15 12:52:25 (12 years ago)
Author:
Seasoft
Message:

#1625 (typo修正・ソース整形・ソースコメントの改善)

Location:
branches/version-2_12-dev/data/class
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/class/pages/admin/system/LC_Page_Admin_System_Plugin.php

    r21501 r21509  
    8484                    $plugin_file_name = $plugin_file['name']; 
    8585                    $plugin_code = $this->getPluginCode($plugin_file_name); 
    86                      
     86 
    8787                    // 既に登録されていないか判定. 
    8888                    if ($this->isInstalledPlugin($plugin_code) === false) { 
     
    107107                    $plugin_id = $objFormParam->getValue('plugin_id'); 
    108108                    $plugin = SC_Helper_Plugin_Ex::getPluginByPluginId($plugin_id); 
    109                      
     109 
    110110                    $this->arrErr = $this->uninstallPlugin($plugin_id, $plugin_code); 
    111111                    // 完了メッセージアラート設定. 
     
    193193                    $this->arrErr['priority'][$plugin_id] = $arrErr['priority']; 
    194194                } 
    195                  
     195 
    196196                break; 
    197197            default: 
     
    289289    function checkPluginFile($file_path, $plugin_code, $key_file) { 
    290290        $arrErr = array(); 
    291          
     291 
    292292        // Archive_Tarを生成します. 
    293293        $tar_obj = new Archive_Tar($file_path); 
    294          
     294 
    295295        // 圧縮ファイル名とディレクトリ名が同一であるかを判定します. 
    296296        if ($this->checkUploadFileName($tar_obj, $plugin_code) === false) { 
     
    385385            return $arrErr; 
    386386        } 
    387          
     387 
    388388        // リフレクションオブジェクトを生成. 
    389389        $objReflection = new ReflectionClass($plugin_code); 
     
    406406        $plugin_html_dir = PLUGIN_HTML_REALDIR . $plugin_code; 
    407407        $this->makeDir($plugin_html_dir); 
    408          
     408 
    409409        $plugin = SC_Helper_Plugin_Ex::getPluginByPluginCode($plugin_code); 
    410410        $arrErr = $this->execPlugin($plugin['plugin_id'], $plugin_code, 'install'); 
    411          
     411 
    412412        return $arrErr; 
    413413    } 
     
    537537        $this->makeDir($unpack_dir); 
    538538        $objUpFile->moveTempFile(); 
    539          
     539 
    540540        // 解凍 
    541541        $update_plugin_file_path = $unpack_dir . "/" . $unpack_file_name; 
     
    626626        return $arrErr; 
    627627    } 
    628      
     628 
    629629    /** 
    630630     * 優先度を更新します. 
  • branches/version-2_12-dev/data/class/plugin/SC_Plugin_TemplateSelector.php

    r21500 r21509  
    4949    } 
    5050 
    51  
    5251    /** 
    5352     * 見つかった要素をプロパティに登録 
     
    9190    } 
    9291 
    93  
    9492    /** 
    9593     * 要素の前にHTMLを挿入 
     
    104102        return $this; 
    105103    } 
    106      
    107104 
    108105    /** 
     
    131128        return $this; 
    132129    } 
    133      
    134      
     130 
    135131    /** 
    136132     * 要素を指定したHTMLに置換 
     
    145141        return $this; 
    146142    } 
    147      
    148      
     143 
    149144    /** 
    150145     * findで見つかったエレメントの数を返す 
     
    155150        return count($this->arrElements); 
    156151    } 
    157      
    158  
    159  
    160152} 
    161  
    162 ?> 
  • branches/version-2_12-dev/data/class/plugin/SC_Plugin_TemplateTransformList.php

    r21500 r21509  
    154154     * @return void 
    155155     */ 
    156     function setHeadNavi($url){ 
     156    function setHeadNavi($url) { 
    157157        $this->arrHeadNaviBlocsByPlugin[$url] = TARGET_ID_HEAD; 
    158158    } 
     
    164164     * @return void 
    165165     */ 
    166     function setHeadNaviBlocs(&$arrBlocs){ 
    167         foreach($this->arrHeadNaviBlocsByPlugin as $key => $value){ 
     166    function setHeadNaviBlocs(&$arrBlocs) { 
     167        foreach ($this->arrHeadNaviBlocsByPlugin as $key => $value) { 
    168168            $arrBlocs[] = array( 
    169169                'target_id' =>$value, 
     
    174174 
    175175} 
    176  
    177 ?> 
  • branches/version-2_12-dev/data/class/plugin/SC_Plugin_TemplateTransformer.php

    r21500 r21509  
    6161        $html = file_get_contents(SMARTY_TEMPLATES_REALDIR . $tmpl); 
    6262        $err_msg = null; 
    63          
     63 
    6464        // 対象のパスが存在するかを検証する, 
    6565        if ($html === false) { 
     
    6868            $err_msg = $tmpl. "の文字コードがUTF-8ではありません"; 
    6969        } 
    70          
     70 
    7171        if (!is_null($err_msg)) { 
    7272            // TODO エラー処理 
     
    7474 
    7575        // JavaScript内にSmartyのタグが存在するものを、コメント形式に置換 
    76         $html = preg_replace_callback( 
    77             '/<script.+?\/script>/s', 
    78             array($this, 'captureSmartyTags2Comment'), 
    79             $html 
    80         ); 
     76        $html = preg_replace_callback( 
     77            '/<script.+?\/script>/s', 
     78            array($this, 'captureSmartyTags2Comment'), 
     79            $html 
     80        ); 
    8181 
    8282        // HTMLタグ内にSmartyのタグが存在するものを、いったんダミーのタグに置換する 
     
    9393            $html 
    9494        ); 
    95          
     95 
    9696        $html = '<meta http-equiv="content-type" content="text/html; charset=UTF-8" /><html><body><!--TemplateTransformer start-->'.$html.'<!--TemplateTransformer end--></body></html>'; 
    9797        // TODO エラー処理 
     
    213213    function scanChild(DOMNode $objDOMElement, $parent_selector = '') { 
    214214        $objNodeList = $objDOMElement->childNodes; 
    215          
     215 
    216216        if (is_null($objNodeList)) return; 
    217217        foreach ($objNodeList as $element) { 
    218              
     218 
    219219            $arrAttr = array(); 
    220220            // エレメントの場合、tag名を配列に入れる. 
     
    222222                $arrAttr[] = $element->tagName; 
    223223            } 
    224              
     224 
    225225            // getAttributeメソッドを持つかを検証 
    226226            if (method_exists($element, 'getAttribute')) { 
    227227                // id属性を持つ場合. 
    228                 if ($element->hasAttribute('id')){ 
     228                if ($element->hasAttribute('id')) { 
    229229                    // idの値を配列に格納(ex: [0] => #hoge) 
    230230                    $arrAttr[] = '#'.$element->getAttribute('id'); 
     
    237237                } 
    238238                // name属性を持つ場合. 
    239                 if ($element->hasAttribute('name')){ 
     239                if ($element->hasAttribute('name')) { 
    240240                    $this->arrDomHash['name'][$element->getAttribute('name')][] = $element; 
    241241                } 
     
    266266 
    267267        if (is_null($objSelector)) $objSelector = new SC_Plugin_TemplateSelector($this, $this->current_plugin); 
    268          
     268 
    269269        // jQueryライクなセレクタを正規表現に 
    270270        $selector = preg_replace('/ *> */', ' >', $selector); 
     
    274274        // セレクターを配列にします. 
    275275        $arrSelectors = explode(' ', $selector);         
    276          
     276 
    277277        // セレクタから正規表現を生成. 
    278278        foreach ($arrSelectors as $sub_selector) { 
     
    295295 
    296296        // エレメントツリーのセレクタを先ほど作成した正規表現で順に検索. 
    297         for($iLoop=$startIndex; $iLoop < count($this->arrElementTree); $iLoop++){ 
    298              
     297        for ($iLoop=$startIndex; $iLoop < count($this->arrElementTree); $iLoop++) { 
     298 
    299299            if (preg_match($regex, $this->arrElementTree[$iLoop][0])) { 
    300300                if (is_null($index) || $cur_idx == $index) { 
     
    314314            ); 
    315315        } 
    316          
     316 
    317317        return $objSelector; 
    318318    } 
    319      
     319 
    320320    /** 
    321321     * DOMを用いた変形を実行する 
     
    327327     */ 
    328328    function setTransform($mode, $target_key, $html_snip) { 
    329          
     329 
    330330        $substitute_tag = sprintf('<!--###%08d###-->', $this->smarty_tags_idx); 
    331331 
     
    333333        $this->arrSmartyTagsSub[$this->smarty_tags_idx] = $substitute_tag; 
    334334        $this->smarty_tags_idx++; 
    335          
     335 
    336336        $objSnip = $this->objDOM->createDocumentFragment(); 
    337337        $objSnip->appendXML($substitute_tag); 
    338          
     338 
    339339        $objElement = false; 
    340         if(isset($this->arrElementTree[$target_key]) && $this->arrElementTree[$target_key][0]){ 
     340        if (isset($this->arrElementTree[$target_key]) && $this->arrElementTree[$target_key][0]) { 
    341341            $objElement = &$this->arrElementTree[$target_key][1]; 
    342342        } 
    343343 
    344344        if (!$objElement) return false; 
    345          
     345 
    346346        try { 
    347347            if ($mode == 'appendChild') { 
     
    351351                $objElement->parentNode->insertBefore($objSnip, $objElement); 
    352352            } elseif ($mode == 'insertAfter') { 
    353                 if ($objElement->nextSibling) { 
    354                      $objElement->parentNode->insertBefore($objSnip, $objElement->nextSibling); 
    355                 } else { 
    356                      $objElement->parentNode->appendChild($objSnip); 
    357                 } 
     353                if ($objElement->nextSibling) { 
     354                     $objElement->parentNode->insertBefore($objSnip, $objElement->nextSibling); 
     355                } else { 
     356                     $objElement->parentNode->appendChild($objSnip); 
     357                } 
    358358            } elseif ($mode == 'replaceChild') { 
    359359                if (!is_object($objElement->parentNode)) return false; 
     
    366366        return true; 
    367367    } 
    368      
     368 
    369369    /** 
    370370     * セレクタエラーを記録する 
     
    384384        ); 
    385385    } 
    386      
     386 
    387387    /** 
    388388     * HTMLに戻して、Transform用に付けたマーカーを削除し、Smartyのタグを復元する 
     
    407407            // TODO エラー処理 
    408408            // ECC_Plugin_Engine::dispError(FREE_ERROR_MSG, "テンプレートの操作に失敗しました。".$err_msg); 
    409          
     409 
    410410        } elseif ($this->snip_count) { 
    411411            $html = $this->objDOM->saveHTML(); 
     
    415415            $html = preg_replace('/<\!--TemplateTransformer end-->.*$/s', '', $html); 
    416416            return $html; 
    417          
     417 
    418418        } else { 
    419419            return false; 
    420420        } 
    421421    } 
    422  
    423422 
    424423    /** 
     
    434433            $filepath = PLUGIN_TMPL_CACHE_REALDIR . $filename; 
    435434            $dir = dirname($filepath); 
    436              
     435 
    437436            if (!file_exists($dir)) mkdir($dir, PLUGIN_DIR_PERMISSION, true); 
    438437            if (!file_put_contents($filepath, $html)) return false; 
     
    444443 
    445444} 
    446  
    447  
    448 ?> 
Note: See TracChangeset for help on using the changeset viewer.