Short description of method initElements

@access public
@author Joel Bout, <joel.bout@tudor.lu>
346513
public function initElements()
    {
        
				$pass1Element = tao_helpers_form_FormFactory::getElement('oldpassword', 'Hiddenbox');
				$pass1Element->setDescription(__('Old Password'));
				$pass1Element->addValidator(
					tao_helpers_form_FormFactory::getValidator('Callback', array(
						'message'	=> __('Passwords are not matching'), 
						'object'	=> tao_models_classes_UserService::singleton(),
						'method'	=> 'isPasswordValid',
						'param'		=> tao_models_classes_UserService::singleton()->getCurrentUser()
				)));
				$this->form->addElement($pass1Element);
				
				$pass2Element = tao_helpers_form_FormFactory::getElement('newpassword', 'Hiddenbox');
				$pass2Element->setDescription(__('New password'));
			    $pass2Element->addValidators( PasswordConstraintsService::singleton()->getValidators() );
			    $pass2Element->setBreakOnFirstError( false );
				$this->form->addElement($pass2Element);
				
				$pass3Element = tao_helpers_form_FormFactory::getElement('newpassword2', 'Hiddenbox');
				$pass3Element->setDescription(__('Repeat new password'));
				$pass3Element->addValidators(array(
					tao_helpers_form_FormFactory::getValidator('Password', array('password2_ref' => $pass2Element)),
				));
				$this->form->addElement($pass3Element);
        
    }
418973
function() {
		if( this.isInitialised === true ) return;

		var i;
	
		lm.items.AbstractContentItem.prototype._$init.call( this );
		
		for( i = 0; i < this.contentItems.length - 1; i++ ) {
			this.contentItems[ i ].element.after( this._createSplitter( i ).element );
		}
	}
36600
public function init()
    {
        $this->assets                                  = array(
            'js' => YII_DEBUG ? 'foundation/foundation.magellan.js' : 'foundation.min.js'
        );
        $this->htmlOptions['data-magellan-expedition'] = Enum::NAV_FIXED;
        parent::init();
    }
649406
protected function initItems()
	{
		$initItems = null;
		
		if ($this->items != null)
		{
			foreach ($this->items as $item)
			{
				if (isset($item['value']))
				{
					$i = $item['value'];
					unset($item['value']);
					$initItems[$i] = $item;
				}
				else 
				{
					$initItems = $this->items;	
				}
			}
			
			$this->items = array_replace($this->defaults, $initItems);
		}
		else 
		{
			$this->items = $this->defaults;
		}
	}
254463
public function init()
    {
        $this->sMode = $this->property('mode');
        if (empty($this->sMode)) {
            $this->sMode = self::MODE_AJAX;
        }
    }
929876
public function init() {
		
		$classes = array();
		
		if ($this->stacked === true) {
			$classes[] = 'btn-group-vertical';
		} else {
			$classes[] = 'btn-group';
		}

		if ($this->dropup === true) {
			$classes[] = 'dropup';
		}
		
		if ($this->justified === true) {
			$classes[] = 'btn-group-justified';
		}

		if (!empty($classes)) {
			$classes = implode(' ', $classes);
			if (isset($this->htmlOptions['class'])) {
				$this->htmlOptions['class'] .= ' ' . $classes;
			} else {
				$this->htmlOptions['class'] = $classes;
			}
		}

		$validToggles = array(self::TOGGLE_CHECKBOX, self::TOGGLE_RADIO);

		if (isset($this->toggle) && in_array($this->toggle, $validToggles)) {
			$this->htmlOptions['data-toggle'] = 'buttons';
		}
	}
131652
function init() {
    var tagName;
    for (var i = 0; i < allTags.length; i++) {
        tagName = allTags[i];
        elems[tagName] = makeElem(tagName);
    }
}
288322
private function initializeItemClasses(): void
    {
        if ($this->item['class']) {
            $classes = StringUtil::trimsplit(' ', $this->item['class']);
            foreach ($classes as $class) {
                $this->itemClass[] = $class;
            }

            if (in_array('trail', $this->itemClass)) {
                $this->itemClass[] = 'active';
            }
        }
    }
485516
protected function initElements()
    {
        
        $property = $this->getPropertyInstance();

	    $index = $this->getIndex();

	    $propertyProperties = array_merge(
			tao_helpers_form_GenerisFormFactory::getDefaultProperties(), 
			array(new core_kernel_classes_Property(GenerisRdf::PROPERTY_IS_LG_DEPENDENT),
                new core_kernel_classes_Property(TaoOntology::PROPERTY_GUI_ORDER),
                $this->getProperty(ValidationRuleRegistry::PROPERTY_VALIDATION_RULE)
			)
		);
	    $values = $property->getPropertiesValues($propertyProperties);
    	
    	$elementNames = array();
		foreach($propertyProperties as $propertyProperty){
		
			//map properties widgets to form elements
			$element = tao_helpers_form_GenerisFormFactory::elementMap($propertyProperty);
			
			if(!is_null($element)){
				//take property values to populate the form
				if (isset($values[$propertyProperty->getUri()])) {
				    $propertyValues = $values[$propertyProperty->getUri()];
				    foreach($propertyValues as $value){
				        if(!is_null($value)){
				            if($value instanceof core_kernel_classes_Resource){
				                $element->setValue($value->getUri());
				            }
				            if($value instanceof core_kernel_classes_Literal){
				                $element->setValue((string)$value);
				            }
				        }
				    }
				}
				$element->setName("{$index}_{$element->getName()}");
                $element->addClass('property');

                if ($propertyProperty->getUri() == TaoOntology::PROPERTY_GUI_ORDER){
                    $element->addValidator(tao_helpers_form_FormFactory::getValidator('Integer'));
                }
                if ($propertyProperty->getUri() == OntologyRdfs::RDFS_LABEL){
                    $element->addValidator(tao_helpers_form_FormFactory::getValidator('NotEmpty'));
                }
				$this->form->addElement($element);
				$elementNames[] = $element->getName();
			}
		}
		
		//build the type list from the "widget/range to type" map
		$typeElt = tao_helpers_form_FormFactory::getElement("{$index}_type", 'Combobox');
		$typeElt->setDescription(__('Type'));
		$typeElt->addAttribute('class', 'property-type property');
		$typeElt->setEmptyOption(' --- '.__('select').' --- ');
		$options = array();
		$checkRange = false;
		foreach(tao_helpers_form_GenerisFormFactory::getPropertyMap() as $typeKey => $map){
			$options[$typeKey] = $map['title'];
            $widget = $property->getWidget();
			if($widget instanceof core_kernel_classes_Resource) {
				if($widget->getUri() == $map['widget']){
					$typeElt->setValue($typeKey);
					$checkRange = is_null($map['range']);
				}
			}
		}
		$typeElt->setOptions($options);
		$this->form->addElement($typeElt);
		$elementNames[] = $typeElt->getName();

	    $range = $property->getRange();

	    $rangeSelect = tao_helpers_form_FormFactory::getElement( "{$this->getIndex()}_range", 'Combobox' );
	    $rangeSelect->setDescription( __( 'List values' ) );
	    $rangeSelect->addAttribute( 'class', 'property-listvalues property' );
	    $rangeSelect->setEmptyOption( ' --- ' . __( 'select' ) . ' --- ' );

	    if ($checkRange) {
		    $rangeSelect->addValidator( tao_helpers_form_FormFactory::getValidator( 'NotEmpty' ) );
	    }

	    $this->form->addElement($rangeSelect);
	    $elementNames[] = $rangeSelect->getName();

	    //list drop down
	    $listElt = $this->getListElement( $range );
		$this->form->addElement($listElt);
		$elementNames[] = $listElt->getName();

	    //trees dropdown
	    $treeElt = $this->getTreeElement( $range );
	    $this->form->addElement($treeElt);
	    $elementNames[] = $treeElt->getName();

	    //index part
        $indexes = $property->getPropertyValues(new \core_kernel_classes_Property(OntologyIndex::PROPERTY_INDEX));
        foreach($indexes as $i => $indexUri){
            $indexProperty = new OntologyIndex($indexUri);
            $indexFormContainer = new tao_actions_form_IndexProperty($indexProperty,$index.$i);
            /** @var tao_helpers_form_Form $indexForm */
            $indexForm = $indexFormContainer->getForm();
            foreach($indexForm->getElements() as $element){
                $this->form->addElement($element);
                $elementNames[] = $element->getName();
            }
        }

        //add this element only when the property is defined (type)
        if(!is_null($property->getRange())){
            $addIndexElt = tao_helpers_form_FormFactory::getElement("index_{$index}_add", 'Free');
            $addIndexElt->setValue(
                "<a href='#' class='btn-info index-adder small index'><span class='icon-add'></span> " . __(
                    'Add index'
                ) . "</a><div class='clearfix'></div>"
            );
            $this->form->addElement($addIndexElt);
            $elementNames[] = $addIndexElt;
        }
        else{
            $addIndexElt = tao_helpers_form_FormFactory::getElement("index_{$index}_p", 'Free');
            $addIndexElt->setValue(
                "<p class='index' >" . __(
                    'Choose a type for your property first'
                ) . "</p>"
            );
            $this->form->addElement($addIndexElt);
            $elementNames[] = $addIndexElt;
        }

        //add an hidden elt for the property uri
        $encodedUri = tao_helpers_Uri::encode($property->getUri());
        $propUriElt = tao_helpers_form_FormFactory::getElement("{$index}_uri", 'Hidden');
        $propUriElt->addAttribute('class', 'property-uri property');
        $propUriElt->setValue($encodedUri);
        $this->form->addElement($propUriElt);
        $elementNames[] = $propUriElt;

		if(count($elementNames) > 0){
			$groupTitle = $this->getGroupTitle($property);
			$this->form->createGroup("property_{$encodedUri}", $groupTitle, $elementNames);
		}

    }
1053614
protected function initElements()
    {


        $clazz = $this->getClassInstance();

        //add a group form for the class edition
        $elementNames = array();
        foreach (tao_helpers_form_GenerisFormFactory::getDefaultProperties() as $property) {

            //map properties widgets to form elements
            $element = tao_helpers_form_GenerisFormFactory::elementMap($property);
            if (!is_null($element)) {

                //take property values to populate the form
                $values = $clazz->getPropertyValues($property);
                if (!$property->isMultiple()) {
                    if (count($values) > 1) {
                        $values = array_slice($values, 0, 1);
                    }
                }
                foreach ($values as $value) {
                    if (!is_null($value)) {
                        $element->setValue($value);
                    }
                }
                $element->setName('class_' . $element->getName());

                //set label validator, read only
                if ($property->getUri() == OntologyRdfs::RDFS_LABEL) {
                    $readonly = tao_helpers_form_FormFactory::getElement($element->getName(), 'Readonly');
                    $readonly->setDescription($element->getDescription());
                    $readonly->setValue($element->getRawValue());
                    $element = $readonly;
                }
                $element->addClass('global');
                $this->form->addElement($element);

                $elementNames[] = $element->getName();
            }
        }

        //add an hidden elt for the class uri
        $classUriElt = tao_helpers_form_FormFactory::getElement('classUri', 'Hidden');
        $classUriElt->setValue(tao_helpers_Uri::encode($clazz->getUri()));
        $classUriElt->addClass('global');
        $this->form->addElement($classUriElt);
        
        $hiddenId = tao_helpers_form_FormFactory::getElement('id', 'Hidden');
        $hiddenId->setValue($clazz->getUri());
        $hiddenId->addClass('global');
        $this->form->addElement($hiddenId);
        

        $localNamespace = common_ext_NamespaceManager::singleton()->getLocalNamespace()->getUri();


        //class properties edition: add a group form for each property

        $classProperties = tao_helpers_form_GenerisFormFactory::getClassProperties($clazz, $this->getTopClazz());

        $i = 0;
        $systemProperties = $this->getSystemProperties();

        foreach ($classProperties as $classProperty) {
            $i++;
            $useEditor = (boolean)preg_match("/^" . preg_quote($localNamespace, '/') . "/", $classProperty->getUri());
            
            $parentProp = true;
            $domains    = $classProperty->getDomain();
            foreach ($domains->getIterator() as $domain) {

                if (array_search($classProperty->getUri(), $systemProperties) !== false || $domain->getUri() == $clazz->getUri() ) {
                    $parentProp = false;
                    //@todo use the getPrivileges method once implemented
                    break;
                }
            }

            if ($useEditor) {

                $propData = array();
                if (isset($this->propertyData[$classProperty->getUri()])) {
                    foreach ($this->propertyData[$classProperty->getUri()] as $key => $value) {
                        $propData[$i.'_'.$key] = $value;
                    }
                }

                $propForm = $this->getPropertyForm($classProperty, $i, $parentProp, $propData);

                //and get its elements and groups
                $this->form->setElements(array_merge($this->form->getElements(), $propForm->getElements()));
                $this->form->setGroups(array_merge($this->form->getGroups(), $propForm->getGroups()));

                unset($propForm);
            }
            // read only properties
            else {
                $roElement = tao_helpers_form_FormFactory::getElement('roProperty' . $i, 'Free');
                $roElement->setValue(__('Cannot be edited'));
                $this->form->addElement($roElement);

                $groupTitle = '<span class="property-heading-label">' . _dh($classProperty->getLabel()) . '</span>';
                $this->form->createGroup("ro_property_{$i}", $groupTitle, array('roProperty' . $i));
            }
        }
    }
495188
protected function initComponents()
    {
        if (!$this->layout->isFallBack()) {
            foreach ($this->layout->settings['components'] as $component => $properties) {
                list($name, $alias) = strpos($component, ' ')
                    ? explode(' ', $component)
                    : [$component, $component];

                $this->addComponent($name, $alias, $properties, true);
            }
        }

        foreach ($this->page->settings['components'] as $component => $properties) {
            list($name, $alias) = strpos($component, ' ')
                ? explode(' ', $component)
                : [$component, $component];

            $this->addComponent($name, $alias, $properties);
        }

        /**
         * @event cms.page.initComponents
         * Fires after the components for the given page have been initialized
         *
         * Example usage:
         *
         *     Event::listen('cms.page.initComponents', function ((\Cms\Classes\Controller) $controller, (\Cms\Classes\Page) $page, (\Cms\Classes\Layout) $layout) {
         *         \Log::info($page->title . ' components have been initialized');
         *     });
         *
         * Or
         *
         *     $CmsController->bindEvent('page.initComponents', function ((\Cms\Classes\Page) $page, (\Cms\Classes\Layout) $layout) {
         *         \Log::info($page->title . ' components have been initialized');
         *     });
         *
         */
        $this->fireSystemEvent('cms.page.initComponents', [$this->page, $this->layout]);
    }
887107
public function init()
    {
        parent::init();
        $this->dataPath = Yii::getAlias($this->dataPath);

        if (Yii::$app instanceof \yii\web\Application) {
            $this->initPanels();
        }
    }
95224
protected function Init()
    {
        $htmlWrap = ContentHtmlWrap::Schema()->ByContent($this->content);
        $this->html = $htmlWrap->GetHtml();
        $this->currentChild = $this->tree->FirstChildOf($this->item);
        return parent::Init();
    }
840093
public function initElement()
    {
        if(is_null($this->settings)) {
            $this->settings = new InputSettings();
        }

        return $this->build($this->settings);
    }
255907
protected function initElements()
    {
		$idElt = \tao_helpers_form_FormFactory::getElement('name', 'Textbox');
		$idElt->setDescription(__('Identifier'));
		$idElt->addValidator(\tao_helpers_form_FormFactory::getValidator('NotEmpty'));
		$idElt->addValidator(\tao_helpers_form_FormFactory::getValidator('AlphaNum'));
		$this->form->addElement($idElt);

		$verElt = \tao_helpers_form_FormFactory::getElement('version', 'Textbox');
		$verElt->setDescription(__('Version'));
		$verElt->addValidator(\tao_helpers_form_FormFactory::getValidator('NotEmpty'));
		$this->form->addElement($verElt);
		
		$authorElt = \tao_helpers_form_FormFactory::getElement('author', 'Textbox');
		$authorElt->setDescription(__('Author'));
		$authValid = \tao_helpers_form_FormFactory::getValidator('NotEmpty');
		$authorElt->addValidator($authValid);
		$authorElt->setValue('Open Assessment Technologies SA');
		$this->form->addElement($authorElt);
		
		$nsElt = \tao_helpers_form_FormFactory::getElement('authorNs', 'Textbox');
		$nsElt->setDescription('Author namespace');
		$nsElt->addValidator(\tao_helpers_form_FormFactory::getValidator('NotEmpty'));
		$nsElt->addValidator(\tao_helpers_form_FormFactory::getValidator('AlphaNum'));
		$nsElt->setValue('oat');
		$this->form->addElement($nsElt);
		
		$licenseElt = \tao_helpers_form_FormFactory::getElement('license', 'Textbox');
		$licenseElt->setDescription(__('License'));
		$licenseElt->setValue('GPL-2.0');
		$this->form->addElement($licenseElt);
		
		$idElt = \tao_helpers_form_FormFactory::getElement('label', 'Textbox');
		$idElt->setDescription(__('Label'));
		$idElt->addValidator(\tao_helpers_form_FormFactory::getValidator('NotEmpty'));
		$this->form->addElement($idElt);

		$descElt = \tao_helpers_form_FormFactory::getElement('description', 'Textarea');
		$descElt->setDescription(__('Description'));
		$this->form->addElement($descElt);
		
		$extIds = array();
		foreach (\common_ext_ExtensionsManager::singleton()->getInstalledExtensions() as $ext) {
		    $extIds[$ext->getId()] = $ext->getId();
		}
		$depElt = \tao_helpers_form_FormFactory::getElement('dependencies', 'Checkbox');
		$depElt->setDescription(__('Depends on'));
		$depElt->setOptions($extIds);
		$depElt->setValue('tao');
		$this->form->addElement($depElt);
		
		$chainingElt = \tao_helpers_form_FormFactory::getElement('samples', 'Checkbox');
		$chainingElt->setDescription(__('Samples'));
		$chainingElt->setOptions(array(
		    'structure' =>  __('sample structure')
			,'theme' => __('custom theme')
		    ,'model' => __('sample model (todo)')
		    ,'rdf' => __('sample rdf install (todo)')
		    ,'install' => __('sample post install script (todo)')
		    ,'uninstall' => __('sample uninstall script (todo)')
		    ,'entry' => __('sample entry point (todo)')
		    ,'itemmodel' => __('sample item model (todo)')
		    ,'testmodel' => __('sample test model todo)')
		    ,'deliverymodel' => __('sample delivery model (todo)')
		));
		$chainingElt->setValue('structure');
		$this->form->addElement($chainingElt);
    }
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,
        ));
    }
646427
function init() {
      if ($el.hasClass('horizontal')){
        scrollDirection = 'horiz';
        scrollOffsetAttr = 'scrollLeft';
        sizeAttr = 'width';
        offsetAttr = 'left';
      }

      $el.prepend('<div class="tse-scrollbar"><div class="drag-handle"></div></div>');
      $scrollbarEl = $el.find('.tse-scrollbar');
      $dragHandleEl = $el.find('.drag-handle');

      if (options.wrapContent) {
        $contentEl.wrap('<div class="tse-scroll-content" />');
      }
      $scrollContentEl = $el.find('.tse-scroll-content');

      resizeScrollContent();

      if (options.autoHide) {
        $el.on('mouseenter', flashScrollbar);
      }

      $dragHandleEl.on('mousedown', startDrag);
      $scrollbarEl.on('mousedown', jumpScroll);
      $scrollContentEl.on('scroll', onScrolled);

      resizeScrollbar();

      $(window).on('resize', function() {
        recalculate();
      });

      if (!options.autoHide) {
        showScrollbar();
      }
    }