Initialize form map
492702
def _init_map(self, record_types=None, **kwargs):
        """"""

        osid_objects.OsidContainableForm._init_map(self)
        osid_objects.OsidSourceableForm._init_map(self)
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['childIds'] = self._children_default
        self._my_map['assignedRepositoryIds'] = [str(kwargs['repository_id'])]
603748
def init_form(self, values=None):
        
        if values:
            values = values.copy()
            values['lt'] = self.request.session['lt'][-1]
        form_initial = {
            'service': self.service,
            'method': self.method,
            'warn': (
                self.warn or self.request.session.get("warn") or self.request.COOKIES.get('warn')
            ),
            'lt': self.request.session['lt'][-1],
            'renew': self.renew
        }
        if settings.CAS_FEDERATE:
            if self.username and self.ticket:
                form_initial['username'] = self.username
                form_initial['password'] = self.ticket
                form_initial['ticket'] = self.ticket
                self.form = forms.FederateUserCredential(
                    values,
                    initial=form_initial
                )
            else:
                self.form = forms.FederateSelect(values, initial=form_initial)
        else:
            self.form = forms.UserCredential(
                values,
                initial=form_initial
            )
764921
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidContainableForm._init_map(self)
        osid_objects.OsidOperableForm._init_map(self)
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        if 'assessment_part_id' in kwargs:
            self._my_map['assessmentPartId'] = str(kwargs['assessment_part_id'])
            if 'mdata' in kwargs:
                self._my_map['sequestered'] = kwargs['mdata']['sequestered']['default_boolean_values'][0]
        else:
            self._my_map['assessmentPartId'] = self._assessment_part_default
            self._my_map['sequestered'] = False  # Parts under Assessments must be "Sections"
        if 'assessment_id' in kwargs:
            self._my_map['assessmentId'] = str(kwargs['assessment_id'])
        else:
            self._my_map['assessmentId'] = self._assessment_default
        self._my_map['assignedBankIds'] = [str(kwargs['bank_id'])]
        self._my_map['allocatedTime'] = self._allocated_time_default
        self._my_map['itemsSequential'] = self._items_sequential_default
        self._my_map['itemsShuffled'] = self._items_shuffled_default
        self._my_map['weight'] = self._weight_default
        if self._supports_simple_sequencing():
            self._my_map['childIds'] = []
1340829
protected function InitForm()
    {
        $this->checkbox = $this->LoadElement();
        $this->AddRequiredField();
        $this->AddNameField();
        $this->AddLabelField();
        $this->AddCheckedField();
        $this->AddCheckedValueField();
        $this->AddDisableFrontendValidationField();
        $this->AddCssIDField();
        $this->AddCssClassField();
        $this->AddTemplateField();
        $this->AddSubmit();
    }
234257
function initializeMap() {
			if($('.map').length) {
				var mapCanvas = $('#map-canvas');
				var myLatlng = new google.maps.LatLng(mapCanvas.data("latitude"),mapCanvas.data("longitude"));
				var mapOptions = {
					zoom: mapCanvas.data("zoom"),
					center: myLatlng
				}
				var map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions);
				
				var marker = new google.maps.Marker({
				  position: myLatlng,
				  map: map
		  	});
			}
		  
		}
650620
def _init_map(self):
        """"""
        DecimalAnswerFormRecord._init_map(self)
        DecimalValuesFormRecord._init_map(self)
        TextAnswerFormRecord._init_map(self)
        TextsFormRecord._init_map(self)
        super(edXNumericResponseAnswerFormRecord, self)._init_map()
1087374
private FormLayout initForm() {

        FormLayout form = new FormLayout();
        form.setWidth("100%");
        m_targetPath = new CmsPathSelectField();
        m_targetPath.setCaption(
            CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_MOVE_TARGET_0));
        m_targetPath.setFileSelectCaption(
            CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_SELECT_TARGET_CAPTION_0));
        m_targetPath.setResourceFilter(CmsResourceFilter.ONLY_VISIBLE_NO_DELETED.addRequireFolder());
        m_targetPath.setWidth("100%");
        form.addComponent(m_targetPath);

        if (m_dialogMode != DialogMode.move) {
            m_actionCombo = new ComboBox();
            m_actionCombo.setCaption(CmsVaadinUtils.getMessageText(org.opencms.ui.Messages.GUI_COPYPAGE_COPY_MODE_0));
            m_actionCombo.setNullSelectionAllowed(false);
            m_actionCombo.setNewItemsAllowed(false);
            m_actionCombo.setWidth("100%");
            if (m_context.getResources().size() == 1) {
                if (m_context.getResources().get(0).isFile()) {
                    m_actionCombo.addItem(Action.copy_all);
                    m_actionCombo.setItemCaption(
                        Action.copy_all,
                        CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_AS_NEW_0));
                    m_actionCombo.addItem(Action.copy_sibling_all);
                    m_actionCombo.setItemCaption(
                        Action.copy_sibling_all,
                        CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_CREATE_SIBLING_0));
                    if (m_dialogMode == DialogMode.copy_and_move) {
                        m_actionCombo.addItem(Action.move);
                        m_actionCombo.setItemCaption(
                            Action.move,
                            CmsVaadinUtils.getMessageText(
                                org.opencms.workplace.commons.Messages.GUI_COPY_MOVE_MOVE_FILE_0));
                    }
                } else {
                    CmsResource folder = m_context.getResources().get(0);
                    m_hasContainerPageDefaultFile = hasContainerPageDefaultFile(folder);
                    if (m_hasContainerPageDefaultFile) {
                        m_actionCombo.addItem(Action.container_page_automatic);
                        m_actionCombo.setItemCaption(
                            Action.container_page_automatic,
                            CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_AUTOMATIC_0));
                        m_actionCombo.addItem(Action.container_page_copy);
                        m_actionCombo.setItemCaption(
                            Action.container_page_copy,
                            CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_CONTAINERPAGE_COPY_0));
                        m_actionCombo.addItem(Action.container_page_reuse);
                        m_actionCombo.setItemCaption(
                            Action.container_page_reuse,
                            CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_CONTAINERPAGE_REUSE_0));
                    }
                    if (CmsResourceTypeFolderSubSitemap.isSubSitemap(folder)) {
                        m_actionCombo.addItem(Action.sub_sitemap);
                        m_actionCombo.setItemCaption(
                            Action.sub_sitemap,
                            CmsVaadinUtils.getMessageText(Messages.GUI_COPY_MOVE_SUBSITEMAP_0));
                    }
                    m_actionCombo.addItem(Action.copy_sibling_mixed);
                    m_actionCombo.setItemCaption(
                        Action.copy_sibling_mixed,
                        CmsVaadinUtils.getMessageText(
                            org.opencms.workplace.commons.Messages.GUI_COPY_ALL_NO_SIBLINGS_0));
                    m_actionCombo.addItem(Action.copy_all);
                    m_actionCombo.setItemCaption(
                        Action.copy_all,
                        CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_ALL_0));
                    m_actionCombo.addItem(Action.copy_sibling_all);
                    m_actionCombo.setItemCaption(
                        Action.copy_sibling_all,
                        CmsVaadinUtils.getMessageText(
                            org.opencms.workplace.commons.Messages.GUI_COPY_MULTI_CREATE_SIBLINGS_0));
                    if (m_dialogMode == DialogMode.copy_and_move) {
                        m_actionCombo.addItem(Action.move);
                        m_actionCombo.setItemCaption(
                            Action.move,
                            CmsVaadinUtils.getMessageText(
                                org.opencms.workplace.commons.Messages.GUI_COPY_MOVE_MOVE_FOLDER_0));
                    }
                }
            } else {
                m_actionCombo.addItem(Action.copy_sibling_mixed);
                m_actionCombo.setItemCaption(
                    Action.copy_sibling_mixed,
                    CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_ALL_NO_SIBLINGS_0));
                m_actionCombo.addItem(Action.copy_all);
                m_actionCombo.setItemCaption(
                    Action.copy_all,
                    CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_ALL_0));
                m_actionCombo.addItem(Action.copy_sibling_all);
                m_actionCombo.setItemCaption(
                    Action.copy_sibling_all,
                    CmsVaadinUtils.getMessageText(
                        org.opencms.workplace.commons.Messages.GUI_COPY_MULTI_CREATE_SIBLINGS_0));
                if (m_dialogMode == DialogMode.copy_and_move) {
                    m_actionCombo.addItem(Action.move);
                    m_actionCombo.setItemCaption(
                        Action.move,
                        CmsVaadinUtils.getMessageText(
                            org.opencms.workplace.commons.Messages.GUI_COPY_MOVE_MOVE_RESOURCES_0));
                }
            }
            m_actionCombo.setItemStyleGenerator(new ItemStyleGenerator() {

                private static final long serialVersionUID = 1L;

                public String getStyle(ComboBox source, Object itemId) {

                    String style = null;
                    if (m_defaultActions.contains(itemId)) {
                        style = "bold";
                    }
                    return style;
                }
            });
            form.addComponent(m_actionCombo);
            m_actionCombo.addValueChangeListener(event -> updateOverwriteExisting());
        }

        if (m_context.getResources().size() > 1) {
            m_overwriteExisting = new CheckBox(
                CmsVaadinUtils.getMessageText(org.opencms.workplace.commons.Messages.GUI_COPY_MULTI_OVERWRITE_0));
            m_overwriteExisting.setValue(Boolean.FALSE);
            form.addComponent(m_overwriteExisting);

            updateOverwriteExisting();
        }

        return form;
    }
1114370
public function initForm()
    {
        $this->form = new \tao_helpers_form_xhtml_Form('export');

        $this->form->setDecorators(array(
            'element'			=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div')),
            'group'				=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-group')),
            'error'				=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-error ui-state-error ui-corner-all')),
            'actions-bottom'	=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-toolbar')),
            'actions-top'		=> new \tao_helpers_form_xhtml_TagWrapper(array('tag' => 'div', 'cssClass' => 'form-toolbar'))
        ));

        $hiddenClassElt = \tao_helpers_form_FormFactory::getElement('xml_desc', 'Hidden');
        $hiddenClassElt->setValue(null);
        $this->form->addElement($hiddenClassElt);
        $hiddenClassElt = \tao_helpers_form_FormFactory::getElement('exportInstance', 'Hidden');
        $hiddenClassElt->setValue(null);
        $this->form->addElement($hiddenClassElt);

        $exportElt = \tao_helpers_form_FormFactory::getElement('export', 'Free');
        $exportElt->setValue('<a href="#" class="form-submitter btn-success small"><span class="icon-export"></span> ' .__('Export metadata').'</a>');
        $this->form->setActions(array($exportElt), 'bottom');

    }
1187598
function initialize() {
  this.sortClass = UNDEFINED;
  this.sortColumnIndex = UNDEFINED;
  this.sortDirection = UNDEFINED;
  this.tableData = [];
  this.bindProperties();
  if ( this.ui.sortButton ) {
    this.sortColumnIndex = this.getColumnIndex();

    this.sortDirection = DIRECTIONS.UP;
    if ( this.ui.sortButton.classList.contains( this.classes.sortDown ) ) {
      this.sortDirection = DIRECTIONS.DOWN;
    }

    this.updateTable();
  }
}
1326111
function initAll() {
        var _this5 = this;

        [].forEach.call(document.forms, function (form) {
            _this5.init(form.id);
        });
    }
509826
def InitMapping(self, values):
        
        for value, prob in values.iteritems():
            self.Set(value, prob)
311658
protected function InitForm()
    {
        $this->htmlWrap = $this->LoadElement();
        $name = 'Html';
        $this->AddRichTextField($name, $this->htmlWrap->GetHtml());
        $this->AddCssClassField();
        $this->AddCssIDField();
        $this->AddSubmit();
    }
230869
protected function initForm()
    {
        (isset($this->options['name'])) ? $name = $this->options['name'] : $name = '';
        if (empty($name)) {
            $name = 'form_' . (count(self::$forms) + 1);
        }
        unset($this->options['name']);

        $this->form = tao_helpers_form_FormFactory::getForm($name, $this->options);

        //add property action in toolbar
        $actions     = tao_helpers_form_FormFactory::getCommonActions();
        $propertyElt = tao_helpers_form_FormFactory::getElement('property', 'Free');
        $propertyElt->setValue(
            "<a href='#' class='btn-info property-adder small'><span class='icon-property-add'></span> " . __('Add property') . "</a>"
        );
        $actions[] = $propertyElt;

        //property mode
        $propModeELt = tao_helpers_form_FormFactory::getElement('propMode', 'Free');
        if($this->propertyMode == 'advanced'){
            $propModeELt->setValue("<a href='#' class='btn-info property-mode small property-mode-simple'><span class='icon-property-advanced'></span> ".__('Simple Mode')."</a>");
        }
        else{
            $propModeELt->setValue("<a href='#' class='btn-info property-mode small property-mode-advanced'><span class='icon-property-advanced'></span> ".__('Advanced Mode')."</a>");
        }

        $actions[] = $propModeELt;

        //add a hidden field that states it is a class edition form.
        $classElt = tao_helpers_form_FormFactory::getElement('tao.forms.class', 'Hidden');
        $classElt->setValue('1');
        $classElt->addClass('global');
        $this->form->addElement($classElt);

        $this->form->setActions($actions, 'top');
        $this->form->setActions($actions, 'bottom');


    }
1137324
function(map, init) {
        map = map || {};

        if (init) {
            this._written = false; // reset writeOnce
        }

        this._initialConfig = this._initialConfig || {};
        
        for (var key in map) {
            if ( map.hasOwnProperty(key) ) {
                this[key] = map[key];
                if (init) {
                    this._initialConfig[key] = map[key];
                }
            }
        }
    }
767911
def _init_map(self, record_types=None, **kwargs):
        """"""
        osid_objects.OsidObjectForm._init_map(self, record_types=record_types)
        self._my_map['url'] = self._url_default
        self._my_map['data'] = self._data_default
        self._my_map['accessibilityTypeId'] = self._accessibility_type_default
        self._my_map['assignedRepositoryIds'] = [str(kwargs['repository_id'])]
        self._my_map['assetId'] = str(kwargs['asset_id'])
74233
protected function initForm()
    {
        $name = isset($this->options['name']) ? $this->options['name'] : '';
        if(empty($name)){
            $name = 'form_'.(count(self::$forms)+1);
        }
        unset($this->options['name']);

        $this->form = tao_helpers_form_FormFactory::getForm($name, $this->options);

        //add translate action in toolbar
        $actions = tao_helpers_form_FormFactory::getCommonActions();

        //add a hidden form element that states that it is an Instance Form.
        $instanceElt = tao_helpers_form_FormFactory::getElement('tao.forms.instance', 'Hidden');
        $instanceElt->setValue('1');
        $this->form->addElement($instanceElt, true);

        //add a token to protect against xsrf
        $tokenElt = tao_helpers_form_FormFactory::getElement('token', 'Token');
        $tokenElt->addValidator(new XsrfTokenValidator());
        $this->form->addElement($tokenElt, true);

        $this->form->setActions($actions, 'top');
        $this->form->setActions($actions, 'bottom');
    }
80987
function formMap(k, v) {
    // customized props
    switch (k) {
        case "link.type": {
            return {
                type: "array",
                title: "link.type",
                items: {
                    enum: Object.keys(LINE_TYPES),
                },
                uniqueItems: true,
            };
        }
    }

    return {
        title: k,
        type: typeof v,
        default: v,
    };
}