Показать сообщение отдельно
Старый 29.08.2007, 16:54   #5
void
Senior Member
 
Аватар для void
 
Регистрация: 14.03.2006
Адрес: Russia, Penza
Сообщений: 1,504
Отправить сообщение для void с помощью ICQ
По умолчанию

А почему бы не сделать так:
Код:
lib.mainContent = USER_INT
lib.mainContent {
	userFunc = user_view->justMain
        whoiam = content
}

// пейджеры нужны только на определённых страницах
[PIDinRootline = {$PAGE_ID1}] [PIDinRootline = {$PAGE_ID2}] ...
lib.mainTopPager = USER_INT
lib.mainTopPager {
	userFunc = user_view->justMain
        whoiam = pagerTop
}

lib.mainBottomPager = USER_INT
lib.mainBottomPager {
	userFunc = user_view->justMain
        whoiam = pagerBottom
}
[GLOBAL]
и
PHP код:
class user_singleton{
 static 
$instance;
  static 
$generated;
  static 
$content;
  static 
$pagerTop;
  static 
$pagerBottom;

 private function 
__construct() {}
 
   public static function 
getInstance() {
     if (!
self::$instance instanceof self) {
       
self::$instance = new self();
     }
     return 
self::$instance;
   }
 function 
justMain($content,$conf){
   if (!
$generated){
      
$this->content $this->genContent();
      
$this->pagerTop $this->genPagerTop();
      
$this->pagerBottom $this->genPagerBottom();
      
$generated true;
   }
   switch (
$conf['whoiam']){
    case 
'content':return $this->content;
    case 
'pagerTop':return $this->pagerTop;
    case 
'pagerBottom':return $this->pagerBottom;
  }
 }
}
class 
user_view
  
$inst;
  function 
__construct(){
     
$this->inst user_singleton::getInstance();
  }
  function 
justMain($content,$conf){
     
$this->inst->justMain($content,$conf);
  }

__________________
TYPO3 FAQ

Последний раз редактировалось void; 29.08.2007 в 17:11
void вне форума   Ответить с цитированием