Beispiel #1
0
 private function searchTags(\Nethgui\View\ViewInterface $view, $query)
 {
     if (is_null($this->moduleSet)) {
         return array();
     }
     $translator = $view->getTranslator();
     $results = array();
     foreach ($this->moduleSet as $module) {
         if (!$module instanceof \Nethgui\Module\ModuleInterface) {
             continue;
         }
         if (!$module->isInitialized()) {
             $module->setPlatform($this->getPlatform());
             $module->initialize();
         }
         $tags = array_map('trim', explode(' ', $module->getAttributesProvider()->getTags()));
         foreach ($tags as $tag) {
             $tagTranslated = $translator->translate($module, $tag);
             if (stripos($tagTranslated, $query) !== FALSE) {
                 $results[] = $view->getModuleUrl('/' . $module->getIdentifier());
             }
         }
     }
     return $results;
 }
 public function getSteps(\Nethgui\View\ViewInterface $view, $currentModuleIdentifier)
 {
     $steps = array();
     foreach ($this->getStepList() as $child) {
         $steps[] = array('target' => $view->getUniqueId($child->getIdentifier()), 'title' => $view->getTranslator()->translate($child, $child->getAttributesProvider()->getTitle()), 'description' => $view->getTranslator()->translate($child, $child->getAttributesProvider()->getDescription()), 'current?' => $child->getIdentifier() === $currentModuleIdentifier);
     }
     return $steps;
 }
 public function getTranslator()
 {
     return $this->view->getTranslator();
 }