Пример #1
0
 public function getCodeOptions()
 {
     $result = [];
     $theme = Theme::getEditTheme();
     $menus = PagesMenu::listInTheme($theme, true);
     foreach ($menus as $menu) {
         $result[$menu->code] = $menu->name;
     }
     return $result;
 }
Пример #2
0
 protected function getData()
 {
     $menus = Menu::listInTheme($this->theme, true);
     $searchTerm = Str::lower($this->getSearchTerm());
     if (strlen($searchTerm)) {
         $words = explode(' ', $searchTerm);
         $filteredMenus = [];
         foreach ($menus as $menu) {
             if ($this->textMatchesSearch($words, $menu->name . ' ' . $menu->fileName)) {
                 $filteredMenus[] = $menu;
             }
         }
         $menus = $filteredMenus;
     }
     return $menus;
 }