Initialize menu pages.
355790
public function init()
    {
        // Get options
        $filter_slug = $this->currentPage;

        // Check sections
        if (!empty($this->options['sections']) && is_array($this->options['sections'])) {
            foreach ($this->options['sections'] as $sectionSlug => $sectionName) {
                if ($sectionSlug !== $this->currentSection) {
                    continue;
                }

                $filter_slug .= '-'.$this->currentSection;
                break;
            }
        }

        /**
         * Build page contents.
         *
         * @var     string  $currentPage
         * @param   array   $contents
         * @return  array   $contents
         */
        $this->fields = apply_filters('ol_zeus_adminpage_'.$filter_slug.'_contents', []);

        // Display main render
        $this->renderFields();
    }
86649
protected function initialize()
    {
        $itemData = $this->getItemData();

        $itemsMerged = array();
        foreach ($itemData as $key => $itemOptions)
        {
            $itemsMerged[$key] = array_merge($this->defaults, $itemOptions);

            if (isset($itemsMerged[$key]['children']['.defaults']))
            {
                $itemsMerged[$key]['children']['.defaults'] = array_merge($this->defaults, $itemsMerged[$key]['children']['.defaults']);
            }
            else
            {
                $itemsMerged[$key]['children']['.defaults'] = $this->defaults;
            }
        }

        $this->baseItem = $this->createItem('', array(
            'title' => '',
            'item_class' => 'C33s\MenuBundle\Item\MenuItem',
            'children' => $itemsMerged,
        ));
    }
792708
private static function init()
    {
        if (!self::$data_initialized) {
            self::$data_initialized = true;

            $page_components_collection = new PageComponentEntityRepository();
            $page_components_collection->setWherePageId(PAGE_ID);
            $page_components_collection->addWhereFieldIsLike('component', 'select_plugin');
            if (Settings::isCacheEnabled()) {
                $page_components_collection->enableUsingCache();
            }

            self::$data = $page_components_collection->getPairs('data', 'component');
        }
    }
583795
public function init()
    {
        $this->routes = $this->routes->getRouteCollections();

        $this->dispatcher = $this->createDispatcher();

        $this->currentURL = $this->request->getPathInfo();

        $this->dispatch();
    }
1323906
public function init()
    {
        $children = array();
        foreach ($this->children as $child_widget) {
            $children[] = $this->remove($child_widget);
        }

        $page = new SwatNoteBookPage();
        $page->id = $page->getUniqueId();
        $page_prototype_id = $page->id;

        foreach ($children as $child_widget) {
            $page->add($child_widget);
        }

        $this->add($page);

        parent::init();

        foreach ($this->replicators as $id => $title) {
            $page = $this->getWidget($page_prototype_id, $id);
            $page->title = $title;
        }

        $note_book = new SwatNoteBook($this->id . '_notebook');

        foreach ($this->children as $child_widget) {
            $page = $this->remove($child_widget);
            $note_book->addPage($page);
        }

        $this->add($note_book);
    }
683158
private void initializeCategoryViews() {
    preferencesFxModel.getFlatCategoriesLst().forEach(category -> {
      CategoryView categoryView = new CategoryView(preferencesFxModel, category);
      CategoryPresenter categoryPresenter = new CategoryPresenter(
          preferencesFxModel, category, categoryView, breadCrumbPresenter
      );
      categoryController.addView(category, categoryView, categoryPresenter);
    });
  }
1150328
def setup_menus():
    ''''''
    global TopMenu
    TopMenu.add(MPMenuSubMenu('Display',
                           items=[MPMenuItem('Map', 'Map', '# map'),
                                  MPMenuItem('Save Graph', 'Save', '# save'),
                                  MPMenuItem('Reload Graphs', 'Reload', '# reload'),
                                  MPMenuItem('FFT', 'FFT', '# fft')]))
    TopMenu.add(graph_menus())
    TopMenu.add(MPMenuSubMenu('FlightMode', items=flightmode_menu()))

    mestate.console.set_menu(TopMenu, menu_callback)
1052924
protected function initNavigation()
    {
        Yii::$app->params['nav']['wavecms_form'] = [
            'label' => FontAwesome::icon('paper-plane') . Yii::t('wavecms_form/main', 'Forms'),
            'url' => 'javascript: ;',
            'options' => [
                'class' => 'drop-down'
            ],
            'permission' => 'wavecms-form',
            'position' => 5000,
            'items' => [
                [
                    'label' => FontAwesome::icon('ellipsis-h') . Yii::t('wavecms_form/main', 'Contact form'),
                    'url' => ['/wavecms-form/contact/index'],
                    'items' => [

                    ]
                ],
                [
                    'label' => FontAwesome::icon('ellipsis-h') . Yii::t('wavecms_form/main', 'Contact form - Settings'),
                    'url' => ['/wavecms-form/contact-settings/page']
                ]

            ]
        ];
    }
621292
def setup(app):
    """"""
    app.connect('html-page-context', add_html_link)
    app.connect('build-finished', create_sitemap)
    app.set_translator('html', HTMLTranslator)
    app.sitemap_links = []
674732
public function Initialize() {
      parent::Initialize();
      if (!C('Vanilla.Categories.Use'))
         Redirect('/discussions');
      if ($this->Menu)
         $this->Menu->HighlightRoute('/categories');
         
      $this->CountCommentsPerPage = C('Vanilla.Comments.PerPage', 30);
   }
42495
def init():
    ""

    if not os.path.exists('site.cfg'):
        f = open('site.cfg', 'w')
        f.write(SITECFG)
        f.close()

    try:
        os.mkdir('queries')
    except OSError:
        pass

    try:
        os.mkdir('templates')
    except OSError:
        pass

    htmlfile = os.path.join('templates', 'homepage.html')
    if not os.path.exists(htmlfile):
        f = open(htmlfile, 'w')
        f.write("""
<!doctype html>
<html>
    <head>
        <title>Chill</title>
    </head>
    <body>
        <p>{{ homepage_content }}</p>
    </body>
</html>
        """)
        f.close()

    app = make_app(config='site.cfg', DEBUG=True)

    with app.app_context():
        app.logger.info("initializing database")
        init_db()

        homepage = insert_node(name='homepage', value=None)
        insert_route(path='/', node_id=homepage)
        insert_query(name='select_link_node_from_node.sql', node_id=homepage)

        add_template_for_node('homepage.html', homepage)

        homepage_content = insert_node(name='homepage_content', value="Cascading, Highly Irrelevant, Lost Llamas")
        insert_node_node(node_id=homepage, target_node_id=homepage_content)
171368
def init_ui(state):
    """"""
    app = state.app
    init_common(app)

    # Register blueprint for templates
    app.register_blueprint(
        blueprint, url_prefix=app.config['USERPROFILES_PROFILE_URL'])
1300677
public function init()
    {
        // Check filepath
        if (empty($this->filepath)) {
            return;
        }

        // Get configurations
        $configs = include $this->filepath;

        // Check
        if (empty($configs)) {
            return;
        }

        // Iterate on configs
        foreach ($configs as $key => $description) {
            $this->addMenu($key, $description);
        }
    }
54134
public function pageStart()
    {
        $config = \OxidEsales\Eshop\Core\Registry::getConfig();

        $config->setConfigParam('iMaxMandates', $config->getConfigParam('IMS'));
        $config->setConfigParam('iMaxArticles', $config->getConfigParam('IMA'));
    }
568940
public function init() {

		if ( ! Book::isBook() ) {
			// Not a book, disable
			return;
		}
		if ( class_exists( '\Pressbooks\CustomCss' ) && CustomCss::isCustomCss() ) {
			// Uses old Custom CSS Editor, disable
			return;
		}

		// Code Mirror
		if ( isset( $_REQUEST['page'] ) && $_REQUEST['page'] === $this::PAGE ) {
			add_action(
				'admin_enqueue_scripts', function () {
					wp_enqueue_script( 'wp-codemirror' );
					wp_enqueue_script( 'csslint' );
					wp_enqueue_style( 'wp-codemirror' );
				}
			);
		}

		add_action(
			'init', function () {
				// Admin Menu
				add_action(
					'admin_menu', function () {
						add_theme_page( __( 'Custom Styles', 'pressbooks' ), __( 'Custom Styles', 'pressbooks' ), 'edit_others_posts', $this::PAGE, [ $this, 'editor' ] );
					}, 11
				);
				// Register Post Types
				$this->registerPosts();
			}
		);

		// Catch form submission
		add_action( 'init', [ $this, 'formSubmit' ], 50 );
	}
138531
def initialize_page_data(self):
        """"""
        if self.term.is_a_tty:
            self.display_initialize()
        self.character_generator = self.character_factory(self.screen.wide)
        page_data = list()
        while True:
            try:
                page_data.append(next(self.character_generator))
            except StopIteration:
                break
        if LIMIT_UCS == 0x10000:
            echo(self.term.center('press any key.').rstrip())
            flushout()
            self.term.inkey(timeout=None)
        return page_data
950609
def add_menu_items_for_pages(self, pagequeryset=None, allow_subnav=True):
        """"""
        item_manager = self.get_menu_items_manager()
        item_class = item_manager.model
        item_list = []
        i = item_manager.count()
        for p in pagequeryset.all():
            item_list.append(item_class(
                menu=self, link_page=p, sort_order=i, allow_subnav=allow_subnav
            ))
            i += 1
        item_manager.bulk_create(item_list)