コード例 #1
0
 /**
  * Bibliotheken aufrufen
  *
  * *Description* Status der jeweiligen Bibliotheken an superglobale Varaible übergeben.
  * Pfad der gewählten Bibliothek zurück geben.
  * 
  * @param array | string
  *
  * @return array
  */
 public function addLibrary($call = array())
 {
     $path = '';
     /** Status in GLOBALS setzen */
     if (is_array($call)) {
         $arr_libraries = $call;
     } else {
         $arr_libraries = array($call);
     }
     if (!empty($arr_libraries)) {
         $globArrLibrary = \Controller\Helpers::getGlobals('Library') ? \Controller\Helpers::getGlobals('Library') : array();
         if (!empty($globArrLibrary) and is_array($globArrLibrary) and !in_array($arr_libraries, $globArrLibrary)) {
             \Controller\Helpers::setGlobals('Library', array_merge($arr_libraries, $globArrLibrary));
         } elseif (!empty($globArrLibrary) and is_array($globArrLibrary)) {
             \Controller\Helpers::setGlobals('Library', $globArrLibrary);
         } else {
             \Controller\Helpers::setGlobals('Library', $arr_libraries);
         }
         /** Pfad holen und zurück geben */
         foreach ($arr_libraries as $lib) {
             if (is_array($globArrLibrary) and !in_array($lib, $globArrLibrary)) {
                 $arr_files = $this->get_libraries->getLibrary($lib);
                 foreach ($arr_files as $files) {
                     $path[] = $files;
                 }
             }
         }
     }
     return $path;
 }
コード例 #2
0
 /**
  * Dateiname aus URL holen
  *
  * *Description* Übergebene GET Parameter aus URI verarbeiten
  *
  * @param string
  *
  * @return string
  */
 private function realURL($uri = NULL)
 {
     $this->page = MAINPAGE;
     if (empty($uri)) {
         $site = isset($this->request['site']) ? $this->request['site'] : NULL;
     } else {
         $site = $uri;
     }
     if (!empty($site) and $this->chkinst) {
         $path_parts = pathinfo($site);
         $categorys = $this->isCategory($path_parts['dirname']);
         $is_site = $this->isSite($path_parts['filename']);
         if (isset($path_parts['extension']) and $is_site and $path_parts['extension'] == EXTENSION and URL_REWRITING and empty($categorys)) {
             $this->response->modifyHeader('status', 200);
             $this->page = $path_parts['filename'];
         } elseif ($is_site and !URL_REWRITING and empty($categorys)) {
             $this->response->modifyHeader('status', 200);
             $this->page = $path_parts['filename'];
         } else {
             $this->page = 'error';
             // Weiterleitung 404 Fehlerseite
             if ($this->isSite($this->page)) {
                 $filename = \Controller\Helpers::buildLink($this->page);
             } else {
                 $filename = \Controller\Helpers::getHost() . '/';
             }
             // Set 404 response code
             $this->response->modifyHeader('status', 404, TRUE);
             $this->response->modifyHeader('location', $filename, TRUE);
         }
         // Weiterleitung Fehlerseite oder Admin
         if ($this->page == 'admin') {
             $this->response->modifyHeader('status', 301, TRUE);
             $this->response->modifyHeader('location', \Controller\Helpers::getHost() . '/admin.php', TRUE);
         }
     }
     //Page als globale Variable verfügbar machen
     \Controller\Helpers::setGlobals('Page', $this->page);
 }