Vloží vršek stránky a hlavní menu.
424611
public function finalize()
    {
        $this->addItem(new MainMenu());

        if (get_class(\Ease\Shared::user()) == 'SpojeNet\System\User') {
            $this->addItem(new History());
        }
    }
897857
function ulMenu($menu, $active)
    {
        $menu || $menu = array();
        $active = str_replace('@', '', $active);
        $opt = [
        	'href'=>'',
        	'label'=>'',
        	'class'=>'',
        	'activeClass'=>'active',
        	'type'=>'ul',
        	'child'=>[
        		'class'=>'',
        		'li'=>[
        			'class'=>'',
        			'attributes'=>[],
        			],
        		'a'=>[
        			'class'=>'',
        			'attributes'=>[],
        			],
        		],
        	'level'=>-1,
        	'hide'=>false,
        	'items'=>[],
        	];
        $menu += $opt;
        $menu['level']++;
        $eol = PHP_EOL;

        $str = sprintf('<%s class="%s">', $menu['type'], ($menu['level']>0?$menu['child']['class']:$menu['class'])).$eol;
        $activeClass = $menu['activeClass'];

        foreach ($menu['items'] as $key => $value) {
        	$value += $opt;

            if ($value['hide'])
                continue;

            $value['label'] || $value['label'] = $key;
            $hasChild = count($value['items'])>0;
            $liAttr   = [
                'class'=>[$menu['child']['li']['class']],
                'attributes'=>$menu['child']['a']['attributes'],
                ];
            $aAttr    = [
                'href'=>$value['href']?:($Instance::get('ALIASES.'.$key)?Instance::siteUrl($key):'#'),
                'class'=>[$menu['child']['a']['class']],
                'attributes'=>$menu['child']['a']['attributes'],
                ];

            $child = '';
            if ($hasChild) {
                $value['level']  = $menu['level'] + 1;
                $child = $eol.$this->ulMenu($value, $active).$eol;
            }

            if ($active === $key || preg_match('/".*'.$activeClass.'.*"/i', $child)) {
                array_push($liAttr['class'], $child);
                array_push($aAttr['class'], $child);
            }

			$attr   = array_pop($liAttr);
			$liAttr = array_merge($liAttr, $attr);
			$attr   = array_pop($aAttr);
			$aAttr  = array_merge($aAttr, $attr);

            $str .= '<li';
            foreach ($liAttr as $key2 => $value2)
                !$value2 || $str .= ' '.$key2.'="'.
                    (is_array($value2)?implode(' ', $value2):$value2).'"';
            $str .= '><a';
            foreach ($aAttr as $key2 => $value2)
                !$value2 || $str .= ' '.$key2.'="'.
                    (is_array($value2)?implode(' ', $value2):$value2).'"';
            $str .= '>'.$value['label'].'</a>';
            $str .= $child;
            $str .= '</li>'.$eol;
        }
        $str .= '</'.$menu['type'].'>';

        return $str;
    }
62599
public function editAction()
    {
        /** @var Menus_Entity_Table_Menu $table */
        $table = ORM::getTable($this->plugin, 'Menu');
        /** @var Menus_Entity_Menu $menu */
        $menu = $table->find(arg('id', 'int'));

        if (is_null($menu))
        {
            return 'Такое меню не найдено.';
        }

        $req = Eresus_CMS::getLegacyKernel()->request;

        if ('POST' == $req['method'])
        {
            $menu->name = arg('name', 'word');
            $menu->caption = arg('caption', 'dbsafe');
            $menu->active = true;
            $menu->root = arg('root', 'int');
            $menu->rootLevel = arg('rootLevel', 'int');
            $menu->invisible = arg('invisible', 'int');
            $menu->expandLevelAuto = arg('expandLevelAuto', 'int');
            $menu->expandLevelMax = arg('expandLevelMax', 'int');
            $menu->dropDown = arg('dropDown', 'int');
            $menu->template = arg('template', 'dbsafe');

            $test = $table->findByName($menu->name);
            if (is_null($test) || $test->id == $menu->id)
            {
                $table->update($menu);
                HTTP::redirect('admin.php?mod=ext-menus&id=' . $menu->id);
            }
            else
            {
                ErrorMessage('Меню с таким именем уже есть');
            }
        }

        $form = new EresusForm($this->plugin->templates()->adminPath('form.html', false));
        $form->setValue('sections', $this->adminSectionBranch());
        $form->setValue('action', 'edit');
        $form->setValue('menu', $menu);
        $html = $form->compile();

        return $html;
    }
706986
public function Menu() {
		$list = new ArrayList();

		$list->push(new ArrayData(array(
			'Link' => sprintf('naut/project/%s', $this->Name),
			'Title' => 'Deploy',
			'IsActive' => Controller::curr()->getAction() == 'project'
		)));

		if(DNRoot::FlagSnapshotsEnabled()) {
			$list->push(new ArrayData(array(
				'Link' => sprintf('naut/project/%s/snapshots', $this->Name),
				'Title' => 'Snapshots',
				'IsActive' => Controller::curr()->getAction() == 'snapshots'
			)));
		}

		$this->extend('updateMenu', $list);

		return $list;
	}
1345792
def set_menu(self, menu):
        
        self.menu = menu
        self.submenu.parent = menu
652521
private void openSubMenu() {

        if (isEnabled() && hasSubMenu() && !m_subMenu.isShowing()) {
            m_overlay.closeSubMenus();

            setFocus(false);
            addStyleName("v-context-menu-item-basic-open");
            m_subMenu.openNextTo(this);
        }
    }
650528
public function handleRequest()
    {
        //obsługa eksportera
        $this->_handleCsvExporter(FrontController::getInstance()->getRequest());
        //obsługa danych z POST
        $post = FrontController::getInstance()->getRequest()->getPost();
        //brak posta
        if ($post->isEmpty()) {
            return;
        }
        //jeśli przebudowano filtry lub sortowania render grida
        if ($this->_rebuildFilter($post) || $this->_rebuildOrder($post)) {
            $this->_render();
        }
    }
530586
private static function _configureLogger()
    {
        //brak konfiguracji
        if (!self::$_config) {
            //tworzy pustą konfigurację
            return new \Psr\Log\NullLogger;
        }
        //nowy obiekt loggera
        $logger = new Logger(self::$_config->getName());
        //iteracja po konfiguracjach instancji
        foreach (self::$_config as $config) {
            self::_configureInstance($config, $logger);
        }
        return $logger;
    }
132624
private function checkLocale()
    {
        if (!isset($this->locales[$this->selectLocale])) {
            // pokud neexistuje jazky hleda v aliasech
            if (isset($this->aliasLocale[$this->selectLocale])) {
                $this->selectLocale = $this->aliasLocale[$this->selectLocale];
            } else {
                $this->selectLocale = $this->defaultLocale;
            }
        }
    }
1011625
public function beforeSave()
    {
        //brak loginu lub hasła
        if (!$this->getElement('username')->getValue() || !$this->getElement('password')->getValue()) {
            return false;
        }
        //autoryzacja
        $auth = \App\Registry::$auth;
        \App\Registry::$auth->setIdentity($this->getElement('username')->getValue());
        \App\Registry::$auth->setCredential($this->getElement('password')->getValue());
        return \App\Registry::$auth->authenticate();
    }
142390
private function menusTranslations()
    {
        $menuItem = $this->_menuItem('Dashboard');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Dashboard');
            $this->_trans('pt', $_arr, 'Painel de Controle');
        }

        $menuItem = $this->_menuItem('Media');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Media');
            $this->_trans('pt', $_arr, 'Media');
        }

        $menuItem = $this->_menuItem('Posts');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Posts');
            $this->_trans('pt', $_arr, 'Publicações');
        }

        $menuItem = $this->_menuItem('Users');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Users');
            $this->_trans('pt', $_arr, 'Utilizadores');
        }

        $menuItem = $this->_menuItem('Categories');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Categories');
            $this->_trans('pt', $_arr, 'Categorias');
        }

        $menuItem = $this->_menuItem('Pages');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Pages');
            $this->_trans('pt', $_arr, 'Páginas');
        }

        $menuItem = $this->_menuItem('Roles');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Roles');
            $this->_trans('pt', $_arr, 'Funções');
        }

        $menuItem = $this->_menuItem('Tools');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Tools');
            $this->_trans('pt', $_arr, 'Ferramentas');
        }

        $menuItem = $this->_menuItem('Menu Builder');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Menu Builder');
            $this->_trans('pt', $_arr, 'Menus');
        }

        $menuItem = $this->_menuItem('Database');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Database');
            $this->_trans('pt', $_arr, 'Base de dados');
        }

        $menuItem = $this->_menuItem('Settings');
        if ($menuItem->exists) {
            $_arr = $this->_arr('menu_items', 'title', $menuItem->id);
            $this->_trans('en', $_arr, 'Settings');
            $this->_trans('pt', $_arr, 'Configurações');
        }
    }
29524
public function editAction()
    {
        $form = new \CmsAdmin\Form\Text(new \Cms\Orm\CmsTextRecord($this->id));
        $this->view->textForm = $form;
        //brak wysłanych danych
        if (!$form->isMine()) {
            return;
        }
        //zapisany
        if ($form->isSaved()) {
            $this->getMessenger()->addMessage('messenger.text.text.saved', true);
            $this->getResponse()->redirect('cmsAdmin', 'text');
        }
        $this->getMessenger()->addMessage('messenger.text.text.error', false);
    }
800362
protected function _prepareData()
	{
        //próba pobrania struktury uprawnień z cache
        if (null !== $this->_acl = \App\Registry::$cache->load($cacheKey = 'categories-roles')) {
			return;
        }
		$this->_acl = [];
		//zapytanie o całą strukturę powiązań: kategorie - role
		foreach ((new \Cms\Orm\CmsCategoryRoleQuery())
					->join('cms_role')->on('cms_role_id')
					->orderAscCmsCategoryId()
					->find() as $record) {
			if (!array_key_exists($record->cmsCategoryId, $this->_acl)) {
				$this->_acl[$record->cmsCategoryId] = [];
			}
			$this->_acl[$record->cmsCategoryId][] = $record->getJoined('cms_role')->name;
		}
        //zapis struktury uprawnień do cache
        \App\Registry::$cache->save($this->_acl, $cacheKey, 0);
	}
117555
protected function _insert()
    {
        //usunięcie cache uprawnień
        \App\Registry::$cache->remove('mmi-cms-category-acl');
        //data aktualizacji
        $this->dateAdd = $this->dateAdd ? $this->dateAdd : date('Y-m-d H:i:s');
        //próba utworzenia rekordu
        return parent::_insert();
    }
281384
public function moveAction()
    {
        $this->getResponse()->setTypeJson();
        //brak kategorii
        if (null === $masterCategory = (new \Cms\Orm\CmsCategoryQuery)->findPk($this->getPost()->id)) {
            return json_encode(['status' => false, 'error' => $this->view->_('controller.category.move.error.missing')]);
        }
        //domyślnie nie ma drafta - alias
        $draft = $masterCategory;
        //zmiana parenta tworzy draft
        if ($this->getPost()->parentId != $masterCategory->parentId) {
            //tworzenie draftu
            $draft = (new \Cms\Model\CategoryDraft($masterCategory))->createAndGetDraftForUser(\App\Registry::$auth->getId(), true);
        }
        //zapis kolejności
        $draft->parentId = ($this->getPost()->parentId > 0) ? $this->getPost()->parentId : null;
        $draft->order = $this->getPost()->order;
        //próba zapisu
        return ($draft->save() && $draft->commitVersion()) ? json_encode(['status' => true, 'id' => $masterCategory->id, 'message' => $this->view->_('controller.category.move.message')]) : json_encode(['status' => false, 'error' => $this->view->_('controller.category.move.error')]);
    }
1352744
function main (params) {
  return new Promise((resolve, reject) => {
    var debug = typeof params.debug === 'boolean' ? params.debug : false

    if (typeof params !== 'object') {
      if (debug) console.log('Format ze starej wersji.')
      /** @throws Dane powinny być podane w formie obiektu, a nie są. */
      reject(new Error('Nieprawidłowy format danych.'))
      return
    }
    if (
      (typeof params.username === 'string' &&
        (params.username !== '' && params.username !== ' ')
      ) &&
      (
        (typeof params.password === 'string' &&
          (params.password !== '' && params.password !== ' ')
        ) ||
        (typeof params.hash === 'string' &&
          (params.hash !== '' && params.hash !== ' ')
        )
      )
    ) {
      if (debug) console.log('Loguję...')
      login(params).then(o => {
        resolve(new Client(params.username, o.agent, o.id, o.hash))
      }).catch(e => {
        reject(e)
      })
    } else {
      reject(new Error('Nieprawidłowy format danych.'))
    }
  })
}
288332
def main():
    """"""
    if len(sys.argv) >= 2:
        cmd = sys.argv[1]
        if cmd == "help":
            print_usage()
        else:
            if cmd == "mensa":
                print_menu("Mensa")
            elif cmd == "bistro":
                print_menu("Bistro")
            elif cmd == "cafeteriab":
                print_menu("CB")
            elif cmd == "west":
                print_menu("West")
            elif cmd == "hochschule":
                print_menu("Prittwitzstr")
            elif cmd == "westside":
                print_menu("Diner", True)
            elif cmd == "burgerbar":
                print_menu("Burgerbar", True)
            else:
                print("[ERROR]: No valid place given")
                print_usage()
    else:
        print("[ERROR]: No argument given")
        print_usage()