/**
  * 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;
 }
Exemplo n.º 2
0
 private final function buildMenu($menuArray)
 {
     $list = '';
     foreach ($menuArray as $node) {
         if ($node['page'] == \Controller\Helpers::getGlobals('Page')) {
             $activ = ' class="activ"';
         } else {
             $activ = '';
         }
         $list .= "\n\t\t\t\t<li>\n\t\t\t\t\t" . '<a href="' . \Controller\Helpers::buildLink($node['page']) . '" title="' . $node['title'] . '"' . $activ . '>' . $node['anchor'] . "</a>\n";
         if (!empty($node['children'])) {
             $list .= "\n\t\t\t\t<ul>\n";
             $list .= $this->buildMenu($node['children']);
             $list .= "\t\t\t\t</ul>\n";
         }
         $list .= "\t\t\t\t</li>\n";
     }
     return $list;
 }