Beispiel #1
0
 /**
  * Laad onderdelen in en duw ze in een template
  *
  * @since	1.0
  */
 public function build()
 {
     //inlezen welke site, pagina, optie geladen is of welke opdracht uitgevoerd moet worden
     //benodigde files inladen en openen
     //site website, heeft enkel een siteID en een to parameter nodig, dus controleren of die er is
     if ($this->conf->offline == "1") {
         $site_conf['state'] = "offline";
         //forceer offline status want server staat op offline..
         $site_conf['message'] = $this->conf->offline_message;
     }
     /*
             //site status controleren en template instellen
             switch($site_conf['state']){
                 default: case "offline":  //site is offline, of de status is niet gekend.
                     $template = "offline";
                     $msg = $site_conf['message'];
                     break;
                 case "running": //site staat online voor iedereen
                     $name = explode('.php',$site_conf['TemplateFile']); //old sites have .php extention in templatename, stripping this out..
                     $template = $name[0];
                     break;
                 case "private": //site staat alleen online voor leden
                     $template = "private";
                     $msg = $site_conf['message'];
                     break;
                 case "admin": //site alleen toegankelijk voor administrators
                     $template = "private_adminonly";
                     $msg = $site_conf['message'];
                     break;
             }
             
             //templatedata
             if($template!="offline") self::createTemplateData($site_conf);
             else{
                 self::createTemplateData($site_conf);
                 $this->templatedata['content'] = $msg;
             }
             
             //template inladen, instellen en dan afsluiten
            $templ = EQFactory::getTemplate($template);
            $templ->give($this->templatedata); //give templatedata to the template
             $templ->input($message);
             if($templ->succes()){
                 $this->output = $templ->get();
             }else{ //error gemaakt ergens..
                 $templ->viewErrors(); 
                 $this->output = $templ->get();
             } */
     $this->template = $this->conf->offline ? "offline" : "listel";
     $templ = ECPFactory::getTemplate($this->template);
     $tdata = self::createTemplateData();
     $templ->give($tdata);
     $templ->input($message);
     if ($templ->succes()) {
         $this->output = $templ->get();
     } else {
         $templ->viewErrors();
         $this->output = $templ->get();
     }
 }