Changeset 15786
- Timestamp:
- 2007/09/20 17:55:30 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/feature-templates/data/class/SC_View.php
r15776 r15786 18 18 /** ¥Ú¡¼¥¸½ÐÎÏ¥Ù¥ó¥Á¥Þ¡¼¥¯¤Î³«»Ï»þ´Ö */ 19 19 var $time_start; 20 /** »ÈÍѤ·¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸Ì¾ */ 21 var $tplName; 20 22 21 23 /** … … 86 88 87 89 /** 88 * ¥Ç¥Õ¥©¥ë¥È ¥Ñ¥é¥á¡¼¥¿¤òassign¤¹¤ë.89 */ 90 function defaultAssign() {90 * ¥Ç¥Õ¥©¥ë¥È¤Î¥Æ¥ó¥×¥ì¡¼¥ÈÊÑ¿ô¤òassign¤¹¤ë. 91 */ 92 function assignDefaultVars() { 91 93 $arrDefaultParams = array( 92 94 'URL_DIR' => URL_DIR, 93 //'TPL_PKG_DIR' => $this->getTemplatePath()95 'TPL_PKG_URL' => URL_DIR . USER_DIR . $this->getTemplateName() . '/' 94 96 ); 95 97 $this->assignArray($arrDefaultParams); … … 212 214 * »ÈÍѤ·¤Æ¤¤¤ë¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸¤Î¥Ñ¥¹¤ò¼èÆÀ¤¹¤ë 213 215 */ 214 function getTemplate Path() {216 function getTemplateName() { 215 217 $objQuery = new SC_Query(); 216 218 $arrRet = $objQuery->select('top_tpl', 'dtb_baseinfo'); 217 219 218 220 if (isset($arrRet[0]['top_tpl'])) { 219 $selectTemplate = $arrRet[0]['top_tpl']; 220 $TPL_PKG_PATH = USER_PATH . "packages/${selectTemplate}/"; 221 222 $TPL_PKG_DIR = URL_DIR . USER_DIR . "packages/${selectTemplate}/"; 223 $this->assign('TPL_PKG_DIR', $TPL_PKG_DIR); 224 225 return $TPL_PKG_PATH; 221 return $arrRet[0]['top_tpl']; 226 222 } 227 223 return null; … … 243 239 $this->_smarty->template_dir = TEMPLATE_ADMIN_DIR; 244 240 $this->_smarty->compile_dir = COMPILE_ADMIN_DIR; 241 $this->assignDefaultVars(); 245 242 } 246 243 247 244 function display($template) { 248 $tpl_mainpage = $this->_smarty->get_template_vars('tpl_mainpage'); 249 $template_dir = $this->getTemplatePath(); 250 251 if ($template_dir) { 252 $template_dir .= 'templates/admin/'; 253 245 $tpl_mainpage = $this->_smarty->get_template_vars('tpl_mainpage'); 246 $template_name = $this->getTemplateName(); 247 echo $tpl_mainpage; 248 echo '<br>'; 249 echo $template_name; 250 echo '<br>'; 251 252 // ¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 253 if ($template_name) { 254 $template_dir = TPL_PKG_PATH . $template_name . '/templates/admin/'; 255 $compile_dir = TPL_PKG_PATH . $template_name . '/templates_c/'; 256 echo $template_dir; 257 echo '<br>'; 258 echo $template; 259 echo '<br>'; 254 260 // tpl_mainpage¤Èmain_frame.tpl¤¬Î¾Êý¸ºß¤¹¤ë»þ¤Î¤ß¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸¤Ç½ÐÎÏ 255 261 if (file_exists($template_dir . $tpl_mainpage) 256 262 && file_exists($template_dir . $template)) { 257 263 echo 'aqa<br>'; 258 264 $this->_smarty->template_dir = $template_dir; 265 $this->_smarty->compile_dir = $compile_dir; 259 266 } 260 267 } … … 283 290 284 291 function display($template) { 285 $tpl_mainpage = $this->_smarty->get_template_vars('tpl_mainpage'); 286 $template_dir = $this->getTemplatePath(); 287 288 if ($template_dir) { 289 $template_dir .= 'templates/'; 290 292 $tpl_mainpage = $this->_smarty->get_template_vars('tpl_mainpage'); 293 $template_name = $this->getTemplateName(); 294 295 // ¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸¤¬ÁªÂò¤µ¤ì¤Æ¤¤¤ë¾ì¹ç 296 if ($template_name) { 297 $template_dir = TPL_PKG_PATH . $template_name . '/templates/'; 298 $compile_dir = TPL_PKG_PATH . $template_name . '/templates_c/'; 299 300 // tpl_mainpage¤Èsite_frame.tpl¤¬Î¾Êý¸ºß¤¹¤ë»þ¤Î¤ß¥Æ¥ó¥×¥ì¡¼¥È¥Ñ¥Ã¥±¡¼¥¸¤Ç½ÐÎÏ 291 301 if ( 292 302 (file_exists($template_dir . $tpl_mainpage) || file_exists($tpl_mainpage)) … … 294 304 295 305 $this->_smarty->template_dir = $template_dir; 306 $this->_smarty->compile_dir = $compile_dir; 296 307 } 297 308 } … … 300 311 } 301 312 } 302 303 313 class SC_UserView extends SC_SiteView{ 304 314 function SC_UserView($template_dir, $compile_dir = COMPILE_DIR) {
Note: See TracChangeset
for help on using the changeset viewer.