示例#1
0
 function getContent($itemObject)
 {
     if (!is_object($itemObject)) {
         return false;
     }
     $myts =& MyTextSanitizer::getinstance();
     $htmlContent = '';
     if ($itemObject->getVar('link') == 0) {
         //			$htmlContent .= $itemObject->getVar('text');
         $htmlContent .= $this->contentRender($itemObject->getVar('text'), $itemObject->getVar('nohtml'), $itemObject->getVar('nosmiley'), $itemObject->getVar('nobreaks'), $this->moduleConfig['tc_space2nbsp']);
     } else {
         // コンテンツを定義したファイルを参照し、文字コードを変換して、必要ならコンテンツ内のURLのパスの部分を書換える。
         $wrap_file = $this->modulePath . '/content/' . $itemObject->getVar('address');
         if (!file_exists($wrap_file)) {
             $htmlContent .= '指定されたファイル' . $wrap_file . 'がありません。';
         } else {
             $contents_html = file_get_contents($wrap_file, true);
             if ($contents_html === false) {
                 $htmlContent .= '指定されたファイル' . $wrap_file . 'が読めません。';
             } else {
                 //					if(!defined('FOR_XOOPS_LANG_CHECKER'))
                 //					{
                 //						$contents_html = mb_convert_encoding($contents_html,mb_internal_encoding(),'auto');
                 //					}
                 if ($itemObject->getVar('link') == TC_WRAPTYPE_CONTENTBASE) {
                 } elseif ($itemObject->getVar('link') == TC_WRAPTYPE_USEREWRITE) {
                 } elseif ($itemObject->getVar('link') == TC_WRAPTYPE_CHANGESRCHREF) {
                     $contents_html = $this->changeSrchref($contents_html, $this->moduleUrl . '/content');
                 }
             }
             $contents_html = str_replace('{X_SITEURL}', XOOPS_URL, $contents_html);
             $htmlContent .= $contents_html;
         }
     }
     return $htmlContent;
 }