Initializes the html code frontend module
@return boolean
420044
protected function Init()
    {
        $htmlCode = ContentHtmlCode::Schema()->ByContent($this->content);
        $this->code= $htmlCode->GetCode();
        return parent::Init();
    }
885265
protected function _initView()
    {
        $this->bootstrap('project');

        // Initialize view
        $view = new \Zend_View();
        $view->addHelperPath('MUtil/View/Helper', 'MUtil_View_Helper');
        $view->addHelperPath('MUtil/Less/View/Helper', 'MUtil_Less_View_Helper');
        $view->addHelperPath('Gems/View/Helper', 'Gems_View_Helper');
        $view->addScriptPath(GEMS_LIBRARY_DIR . '/views/scripts');
        $view->headTitle($this->project->getName());
        $view->setEncoding('UTF-8');

        $metas    = $this->project->getMetaHeaders();
        $headMeta = $view->headMeta();
        foreach ($metas as $httpEquiv => $content) {
            $headMeta->appendHttpEquiv($httpEquiv, $content);
        }

        if ($this->useHtml5) {
            $view->doctype(\Zend_View_Helper_Doctype::HTML5);
        } else {
            $view->doctype(\Zend_View_Helper_Doctype::XHTML1_STRICT);
        }

        // Add it to the ViewRenderer
        $viewRenderer = \Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer');
        $viewRenderer->setView($view);

        // Return it, so that it can be stored by the bootstrap
        return $view;
    }
920493
public function init() {

		// Gets options to load
    	$options = & Options_Framework::_optionsframework_options();

		// Checks if options are available
    	if ( $options ) {

			// Add the options page and menu item.
			add_action( 'admin_menu', array( $this, 'add_custom_options_page' ) );

			// Add the required scripts and styles
			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_styles' ) );
			add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ) );

			// Settings need to be registered after admin_init
			add_action( 'admin_init', array( $this, 'settings_init' ) );

			// Adds options menu to the admin bar
			add_action( 'wp_before_admin_bar_render', array( $this, 'optionsframework_admin_bar' ) );

		} else {
			// Display a notice if options aren't present in the theme
			add_action( 'admin_notices', array( $this, 'options_notice' ) );
			add_action( 'admin_init', array( $this, 'options_notice_ignore' ) );
		}

    }
292330
public function init()
    {
        parent::init();

        $this->form->addHook('displayError', function ($form, $fieldName, $str) {
            // default behavior
            $jsError = [$form->js()->form('add prompt', $fieldName, $str)];

            // if field is part of an accordion section, will open that section.
            $section = $form->getClosestOwner($form->getField($fieldName), '\atk4\ui\AccordionSection');
            if ($section) {
                $jsError[] = $section->owner->jsOpen($section);
            }

            return $jsError;
        });
    }
843430
protected function _init() {
        /* ############## APP ############## */

        /* ## LANG ## */
        if ($handle = opendir(APP_RESOURCE_LANG_PATH)) {
            while (false !== ($entry = readdir($handle))) {
                if (preg_match('#(' . preg_quote('.xml') . ')$#isU', $entry)) {
                    $this->_parseLang(null, str_replace('.xml', '', $entry));
                }
            }

            closedir($handle);
        }

        /* ## TEMPLATE ## */
        $this->config['template']['app'] = APP_RESOURCE_TEMPLATE_PATH;
        /* ## CSS ## */
        $this->config['css']['app'] = WEB_PATH . 'app/' . WEB_CSS_PATH;
        /* ## IMAGE ## */
        $this->config['img']['app'] = WEB_PATH . 'app/' . WEB_IMAGE_PATH;
        /* ## FILE ## */
        $this->config['file']['app'] = WEB_PATH . 'app/' . WEB_FILE_PATH;
        /* ## JS ## */
        $this->config['js']['app'] = WEB_PATH . 'app/' . WEB_JS_PATH;

        /* ############## SRC ############## */

        if ($handleSrc = opendir(SRC_PATH)) {
            while (false !== ($entrySrc = readdir($handleSrc))) {
                if (is_dir(SRC_PATH . $entrySrc) && $entrySrc != '.' && $entrySrc != '..') {
                    /* ## ROUTE ## */
                    $this->_parseRoute($entrySrc);

                    /* ## LANG ## */
                    if ($handle = opendir(SRC_PATH . $entrySrc . '/' . SRC_RESOURCE_LANG_PATH)) {
                        while (false !== ($entry = readdir($handle))) {
                            if (preg_match('#(' . preg_quote('.xml') . ')$#isU', $entry)) {
                                $lang = str_replace('.xml', '', $entry);
                                $this->_parseLang($entrySrc, $lang);
                            }
                        }

                        closedir($handle);
                    }

                    /* ## TEMPLATE ## */
                    $this->config['template']['' . $entrySrc . ''] = SRC_PATH . $entrySrc . '/' . SRC_RESOURCE_TEMPLATE_PATH;
                    /* ## CSS ## */
                    $this->config['css']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_CSS_PATH;
                    /* ## IMAGE ## */
                    $this->config['img']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_IMAGE_PATH;
                    /* ## FILE ## */
                    $this->config['file']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_FILE_PATH;
                    /* ## JS ## */
                    $this->config['js']['' . $entrySrc . ''] = WEB_PATH . $entrySrc . '/' . WEB_JS_PATH;
                    /* ## FIREWALL ## */
                    $this->_parseFirewall($entrySrc);

                    //copy app lang in each other module lang
                    foreach ($this->config['lang'] as $key => $value) {
                        if ($key != 'app') {
                            foreach ($value as $key2 => $value2) {
                                $this->config['lang']['' . $key . '']['' . $key2 . ''] = array_merge($this->config['lang']['app']['' . $key2 . ''], $value2);
                            }
                        }
                    }

                    /* ## ANNOTATIONS ## */
                    $controllers = scandir(SRC_PATH . $entrySrc . '/' . SRC_CONTROLLER_PATH);

                    foreach ($controllers as $controller) {
                        if (strlen($controller) > 2) {
                            $annotation = Annotation::getClass('Src\\' . $entrySrc . '\\Controller\\' . basename($controller, '.php'));
                            $this->_parseAnnotationRoute($entrySrc, $controller, $annotation);
                            $this->_parseAnnotationCron($entrySrc, $controller, $annotation);
                        }
                    }

                    /* ## ENTITIES ## */
                    $entities = scandir(APP_RESOURCE_ENTITY_PATH);

                    foreach ($entities as $entity) {
                        if (strlen($entity) > 2 && strstr($entity, '.')) {
                            Annotation::getClass('\\Gcs\\App\Resource\\Entity\\' . basename($entity, '.php'));
                        }
                    }
                }
            }

            closedir($handleSrc);
        }
        else {
            throw new Exception('The directory ' . SRC_PATH . 'doesn\'t exist');
        }

        if ($this->config['user']['output']['cache']['config']) {
            $this->_cache->setContent($this->config);
            $this->_cache->setCache();
        }
    }
1316517
public function initialise() {
        if ($this->initialised || during_initial_install()) {
            return false;
        }
        $this->context = $this->page->context;
        $this->load_administration_settings();

        // Check if local plugins is adding node to site admin.
        $this->load_local_plugin_settings();

        $this->initialised = true;
    }
1104604
public function init()
	{
		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		$classes = array();

		$validPlacements = array(
			self::PLACEMENT_ABOVE,
			self::PLACEMENT_BELOW,
			self::PLACEMENT_LEFT,
			self::PLACEMENT_RIGHT
		);

		if (isset($this->placement) && in_array($this->placement, $validPlacements)) {
			$classes[] = 'tabs-' . $this->placement;
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}
	}
186547
public static function __initialize():bool
    {
        $env = (new ModuleManager())->getCurrentEnv();
        $base =  realpath(__DIR__.'/../../../../../../').DIRECTORY_SEPARATOR;
        self::__setPaths($base, $env, '', true);
        FEnv::set(
            "framework.fcm.config.commands.file",
            $base."vendor/iumio/framework/Core/Additional/Manager/Configs/commands.json"
        );
        return (true);
    }
911177
public function init()
	{
		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		if ($this->autoOpen === false && !isset($this->options['show'])) {
			$this->options['show'] = false;
		}

		$classes = array('modal');

		if ($this->fade === true) {
			$classes[] = 'fade';
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}
		echo CHtml::openTag('div', $this->htmlOptions);
	}
584808
protected function Init()
    {
        $this->confirm = ContentRegisterConfirm::Schema()->ByContent($this->Content());
        $this->confirmer = new Confirmer();
        $this->isValid = $this->confirmer->Check(Request::GetArray());
        if ($this->isValid)
        {
            $this->OnSuccess();
        }
        else if ($this->confirm->GetErrorUrl())
        {
            Response::Redirect(FrontendRouter::Url($this->confirm->GetErrorUrl()));
            return true;
        }
        return parent::Init();
    }
1231042
public function init() {
		
		if (!isset($this->htmlOptions['id'])) {
			$this->htmlOptions['id'] = $this->getId();
		}

		if (isset($this->parent) && !isset($this->options['parent'])) {
			$this->options['parent'] = $this->parent;
		}

		if (isset($this->toggle) && !isset($this->options['toggle'])) {
			$this->options['toggle'] = $this->toggle;
		}

		// NOTE: we depend on the htmlOptions being initialized to empty array already.
		if (empty($this->htmlOptions['class'])) {
			$this->htmlOptions['class'] = 'collapse';
		} else {
			$this->htmlOptions['class'] .= ' collapse';
		}
		echo CHtml::openTag($this->tagName, $this->htmlOptions);
	}
535142
public function init()
	{
		if(isset($this->htmlOptions['id']))
			$id=$this->htmlOptions['id'];
		else
			$id=$this->htmlOptions['id']=$this->getId();
		if($this->url!==null)
			$this->url=CHtml::normalizeUrl($this->url);
		$cs=Yii::app()->getClientScript();
		$cs->registerCoreScript('treeview');
		$options=$this->getClientOptions();
		$options=$options===array()?'{}' : CJavaScript::encode($options);
		$cs->registerScript('Yii.CTreeView#'.$id,"jQuery(\"#{$id}\").treeview($options);");
		if($this->cssFile===null)
			$cs->registerCssFile($cs->getCoreScriptUrl().'/treeview/jquery.treeview.css');
		elseif($this->cssFile!==false)
			$cs->registerCssFile($this->cssFile);

		echo CHtml::tag('ul',$this->htmlOptions,false,false)."\n";
		echo self::saveDataAsHtml($this->data);
	}
102452
final public function init()
    {
        $sm = $this->getServiceLocator();
        $config = $sm->get($this->moduleService)->config();
        if (array_key_exists('*', $config)) {
            // Inject form instance if * is closure
            if (is_object($config['*']) && $config['*'] instanceof \Closure) {
                $form = $config['*']($this);
            }
        }
        $this->initialize();
        // Initialize form elements
        foreach ($this->getFormElements() as $element) {
            $elementOptions = array();
            if (array_key_exists($element['name'], $this->formElementOptions)) {
                $elementOptions = $this->formElementOptions[$element['name']];
            }
            // Add id attribute for each element
            if (!array_key_exists('attributes', $element)) {
                $element['attributes'] = array();
                $element['attributes'] ['id'] = $element['name'];
            } else {
                $element['attributes'] ['id'] = $element['name'];
            }
            $this->add($element, $elementOptions);
        }
        return $this;
    }
1183710
private function init()
    {
        $aData = $this->data;

        $this
            // Required value rules
            ->addRule(
                'required',
                function ($sFieldName) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        return true;
                    }
                    return false;
                },
                function ($sFieldName) {
                    return "Field '{$sFieldName}' is required.";
                }
            )
            // String rules
            ->addRule(
                'string',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_string($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['notEmpty'])) {
                            $mTmp = trim($mValue);
                            if ($aOpt['notEmpty'] && empty($mTmp)) {
                                return false;
                            }
                            if (!$aOpt['notEmpty'] && !empty($mTmp)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['pattern'])) {
                            if (!preg_match($aOpt['pattern'], $mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['length'])) {
                            $nLength = mb_strlen($mValue, 'UTF-8');
                            if (isset($aOpt['length']['min'])) {
                                if ($nLength < $aOpt['length']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['max'])) {
                                if ($nLength > $aOpt['length']['max']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['equal'])) {
                                if ($nLength != $aOpt['length']['equal']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid string field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid string field '{$sFieldName}' value.";
                }
            )
            // Number rules
            ->addRule(
                'number',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_numeric($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['float'])) {
                            if ($aOpt['float'] && !is_float($mValue)) {
                                return false;
                            }
                            if (!$aOpt['float'] && is_float($mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['integer'])) {
                            if ($aOpt['integer'] && !is_int($mValue)) {
                                return false;
                            }
                            if (!$aOpt['integer'] && is_int($mValue)) {
                                return false;
                            }
                        }
                        if (isset($aOpt['positive'])) {
                            if ($aOpt['positive'] && $mValue <= 0) {
                                return false;
                            }
                            if (!$aOpt['positive'] && $mValue >= 0) {
                                return false;
                            }
                        }
                        if (isset($aOpt['value'])) {
                            if (isset($aOpt['value']['equal'])) {
                                if ($mValue != $aOpt['value']['equal']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['value']['min'])) {
                                if ($mValue < $aOpt['value']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['value']['max'])) {
                                if ($mValue > $aOpt['value']['max']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid number field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid number field '{$sFieldName}' value.";
                }
            )
            // Array rules
            ->addRule(
                'array',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_array($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['assoc'])) {
                            $funcIsAssoc = function (array $aArray) {
                                // return false if array is empty
                                return (bool) count(array_filter(
                                    array_keys($aArray),
                                    'is_string'
                                ));
                            };
                            if ($aOpt['assoc'] && !$funcIsAssoc($mValue)) {
                                return false;
                            }
                            if (!$aOpt['assoc'] && $funcIsAssoc($mValue)) {
                                return false;
                            }
                            unset($funcIsAssoc);
                        }
                        if (isset($aOpt['length'])) {
                            $nLength = count($mValue);
                            if (isset($aOpt['length']['min'])) {
                                if ($nLength < $aOpt['length']['min']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['max'])) {
                                if ($nLength > $aOpt['length']['max']) {
                                    return false;
                                }
                            }
                            if (isset($aOpt['length']['equal'])) {
                                if ($nLength != $aOpt['length']['equal']) {
                                    return false;
                                }
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid array field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid array field '{$sFieldName}' value.";
                }
            )
            // Boolean rules
            ->addRule(
                'boolean',
                function ($sFieldName, array $aOpt = array()) use ($aData) {
                    if (\nadir\core\validator\Validator::isIndexSet(
                        $aData,
                        $sFieldName
                    )) {
                        $mValue = \nadir\core\validator\Validator
                        ::getArrayItemByPointSeparatedKey($aData, $sFieldName);
                        if (!is_bool($mValue)) {
                            return false;
                        }
                        if (isset($aOpt['isTrue'])) {
                            if ($aOpt['isTrue'] && !$mValue) {
                                return false;
                            }
                            if (!$aOpt['isTrue'] && $mValue) {
                                return false;
                            }
                        }
                    }
                    return true;
                },
                function ($sFieldName, array $aOpt = array()) {
                    if (!empty($aOpt)) {
                        $aKeys = array_keys($aOpt);
                        $sKeys = implode(', ', $aKeys);
                        return "Invalid boolean field '{$sFieldName}' value. "
                        . "Validation options: {$sKeys}";
                    }
                    return "Invalid boolean field '{$sFieldName}' value.";
                }
            );
    }
701952
public function init()
    {
        if (isset($this->htmlOptions['class'])) {
            $this->htmlOptions['class'] = 'bootstrap-widget ' . $this->htmlOptions['class'];
        } else {
            $this->htmlOptions['class'] = 'bootstrap-widget';
        }

        if (isset($this->htmlContentOptions['class'])) {
            $this->htmlContentOptions['class'] = 'bootstrap-widget-content ' . $this->htmlContentOptions['class'];
        } else {
            $this->htmlContentOptions['class'] = 'bootstrap-widget-content';
        }

        if (!isset($this->htmlContentOptions['id'])) {
            $this->htmlContentOptions['id'] = $this->getId();
        }

        if (isset($this->htmlHeaderOptions['class'])) {
            $this->htmlHeaderOptions['class'] = 'bootstrap-widget-header ' . $this->htmlHeaderOptions['class'];
        } else {
            $this->htmlHeaderOptions['class'] = 'bootstrap-widget-header';
        }

        $this->attachBehavior('ywplugin', array('class' => 'yiiwheels.behaviors.WhPlugin'));

        echo CHtml::openTag('div', $this->htmlOptions);

        $this->registerClientScript();
        $this->renderHeader();
        $this->renderContentBegin();
    }
689802
public function initialize()
    {
        parent::initialize();

        $this->eventsManager->attach('view:notFoundView', function ($event, \Phalcon\Mvc\ViewInterface $view) {
            if (!in_array($this->dispatcher->getActionName(), ['new', 'edit', 'show', 'index'])) {
                return false;
            }

            if ($view->getCurrentRenderLevel() == View::LEVEL_ACTION_VIEW) {
                $templatePath = implode(DIRECTORY_SEPARATOR, [dirname(__FILE__), 'Crud','']);

                $view->setViewsDir($templatePath);
                $view->setControllerViewPath('views');
                $view->setRenderLevel(View::LEVEL_ACTION_VIEW);

                $view->render('', $this->dispatcher->getActionName());
            }
        });
    }
779637
private function __init()
    {
        $this->_session = Session::start($this->_timeout, $this->_path, $this->_domain, $this->_httpOnly, $this->_secure);

        if (!$this->_session) {
            return false;
        }

        if (!isset($_SESSION[$this->_index])) {
            $_SESSION[$this->_index] = array();
        }

        // Class FrontendPage uses $_COOKIE directly (inside it's __buildPage() function), so try to emulate it.
        // @deprecated will be removed in Symphony 3.0.0
        $_COOKIE[$this->_index] = &$_SESSION[$this->_index];

        return $this->_session;
    }