コード例 #1
0
 public function renderFormLayout($form = null)
 {
     $nameElement = new TextElement($this->getModel(), 'name', $form);
     $nameElement->editableTemplate = '{content}{error}';
     $taskInput = ZurmoHtml::tag('div', array('class' => 'task-input'), $nameElement->render());
     $params = array('label' => Zurmo::t('TasksModule', 'Add'));
     $element = new SaveButtonActionElement($this->controllerId, $this->moduleId, $this->modelId, $params);
     $addButton = ZurmoHtml::tag('div', array('class' => 'task-add-button'), $element->render());
     return $taskInput . $addButton;
 }
コード例 #2
0
 protected function renderControlEditable()
 {
     $this->renderSearchScript();
     $content = '<button type="button" class="global-search-loopa" aria-haspopup="true"><span></span></button>';
     $content .= parent::renderControlEditable();
     return $content;
 }
コード例 #3
0
 public function getDataArray()
 {
     $output = parent::getDataArray();
     $output['type'] = "textarea";
     $output['height'] = $this->height;
     return $output;
 }
コード例 #4
0
 protected function getDisabledValue()
 {
     if (!Yii::app()->user->userModel->isRootUser) {
         return 'disabled';
     }
     return parent::getDisabledValue();
 }
コード例 #5
0
 protected function renderDelimiterAndEnclosureContent($existingFilesInformation)
 {
     assert('is_array($existingFilesInformation)');
     $params = array('htmlOptions' => array('size' => 5, 'encode' => 1));
     if (count($existingFilesInformation) == 1) {
         $params['htmlOptions']['readonly'] = 'readonly';
         $params['htmlOptions']['class'] = 'readonly-field';
     }
     $delimiterElement = new TextElement($this->model, 'rowColumnDelimiter', $this->form, $params);
     $delimiterElement->editableTemplate = '<tr><td>{label}</td><td colspan="3">{content}</td></tr>';
     $enclosureElement = new TextElement($this->model, 'rowColumnEnclosure', $this->form, $params);
     $enclosureElement->editableTemplate = '<tr><td>{label}</td><td colspan="3">{content}</td></tr>';
     $content = $delimiterElement->render();
     $content .= $enclosureElement->render();
     return $content;
 }
コード例 #6
0
 /**
  * @return string
  */
 protected function renderFormContent()
 {
     $leftSideContent = null;
     $element = new TextElement($this->model, 'name', $this->form);
     $element->editableTemplate = '<th>{label}<span class="required">*</span></th><td colspan="{colspan}">{content}{error}</td>';
     $leftSideContent = '<table class="form-fields"><colgroup><col class="col-0"><col class="col-1">' . '</colgroup><tr>' . $element->render() . '</tr>';
     $element = new TextAreaElement($this->model, 'description', $this->form, array('rows' => 5));
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new TriggerOnStaticDropDownElement($this->model, 'triggerOn', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CheckBoxElement($this->model, 'isActive', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $leftSideContent .= '</table>';
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'panel'), $leftSideContent);
     $content = '<div class="attributesContainer">';
     $content .= $leftSideContent;
     $content .= '</div>';
     return $content;
 }
コード例 #7
0
ファイル: BaseDomainElement.php プロジェクト: youprofit/Zurmo
 protected function renderLabel()
 {
     $title = Zurmo::t('ZurmoModule', 'Like: dc=server,dc=world for both LDAP and Active Directory');
     // Not Coding Standard
     $content = parent::renderLabel();
     $content .= '<span id="ldap-rollup-tooltip" class="tooltip" title="' . $title . '">?</span>';
     $qtip = new ZurmoTip();
     $qtip->addQTip("#ldap-rollup-tooltip");
     return $content;
 }
コード例 #8
0
 /**
  * Generated from @assert
  */
 public function testRender()
 {
     $e = new TextElement("xy");
     $e->setAttribute("name", "dddddddd");
     $e->setLabel('ddd', 'sdfdsfdsfs', 'css');
     $this->object->setAttribute("id", "test");
     $this->object->setAttribute("target", "_blank");
     $this->object->setElement($e);
     $e1 = new HtmlScript();
     $e1->setScript("<a herf='aa.html' target='_blank'>");
     $this->object->setElement($e1);
     $e2 = new TextElement("xy1");
     $e2->setAttribute("name", "dddddddd11");
     $e2->setLabel('ddd', 'sdfdsfdsfs1', 'css1');
     $this->object->setElement($e2);
     $e3 = new HtmlScript();
     $e3->setScript("</a>");
     $this->object->setElement($e3);
     $output = "<form id='test' target='_blank'><div id='ddd' class='css'>sdfdsfdsfs</div><input id='xy' type='text' name='dddddddd'><a herf='aa.html' target='_blank'><div id='ddd' class='css1'>sdfdsfdsfs1</div><input id='xy1' type='text' name='dddddddd11'></a></form>";
     $this->assertEquals($output, $this->object->render());
 }
コード例 #9
0
 public function testEditableHtmlOptionsInputValue()
 {
     $model = new User();
     $this->assertTrue($model->id < 0);
     $form = new ZurmoActiveForm();
     $textElement = new TextElement($model, 'id', $form);
     $content = $textElement->render();
     $valPosition = strpos($content, 'value=""');
     $valInvalidPosition = strpos($content, 'value="' . $model->id . '"');
     $this->assertTrue($valPosition > 0);
     $this->assertFalse($valInvalidPosition > 0);
     //Valid case
     $model = User::getByUsername('super');
     $this->assertTrue($model->id > 0);
     $textElement = new TextElement($model, 'id', $form);
     $content = $textElement->render();
     $valInvalidPosition = strpos($content, 'value=""');
     $valPosition = strpos($content, 'value="' . $model->id . '"');
     $this->assertTrue($valPosition > 0);
     $this->assertFalse($valInvalidPosition > 0);
 }
コード例 #10
0
 /**
  * @return string
  */
 protected function renderFormContent()
 {
     $leftSideContent = null;
     $element = new TextElement($this->model, 'name', $this->form);
     $element->editableTemplate = '<th>{label}<span class="required">*</span></th><td colspan="{colspan}">{content}{error}</td>';
     $leftSideContent = '<table><colgroup><col class="col-0"><col class="col-1">' . '</colgroup><tr>' . $element->render() . '</tr>';
     $element = new TextAreaElement($this->model, 'description', $this->form, array('rows' => 5));
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CurrencyConversionTypeStaticDropDownElement($this->model, 'currencyConversionType', $this->form);
     $leftSideContent .= '<tr>' . $element->render() . '</tr>';
     $element = new CurrencyCodeStaticDropDownFormElement($this->model, 'spotConversionCurrencyCode', $this->form, array('addBlank' => true));
     $leftSideContent .= '<tr>' . $element->render() . '</tr></table>';
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'panel'), $leftSideContent);
     $leftSideContent = ZurmoHtml::tag('div', array('class' => 'left-column'), $leftSideContent);
     $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-side-edit-view-panel'), $this->renderRightSideFormLayout());
     $rightSideContent = ZurmoHtml::tag('div', array('class' => 'right-column'), $rightSideContent);
     $content = '<div class="attributesContainer">';
     $content .= $leftSideContent . $rightSideContent;
     $content .= '</div>';
     return $content;
 }
コード例 #11
0
 protected function renderMissionContent()
 {
     $userUrl = Yii::app()->createUrl('/users/default/details', array('id' => $this->model->createdByUser->id));
     $content = '<div class="comment model-details-summary">';
     $content .= ZurmoHtml::link($this->model->createdByUser->getAvatarImage(100), $userUrl);
     $content .= '<span class="user-details">';
     $content .= ZurmoHtml::link(strval($this->model->createdByUser), $userUrl, array('class' => 'user-link'));
     $content .= '</span>';
     $element = new TextAreaElement($this->model, 'description');
     $element->nonEditableTemplate = '<div class="comment-content">{content}</div>';
     $content .= $element->render();
     if ($this->model->reward != null) {
         $element = new TextElement($this->model, 'reward');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Reward') . ': {content}</div>';
         $content .= $element->render();
     }
     if ($this->model->takenByUser->id > 0) {
         $element = new UserElement($this->model, 'takenByUser');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Taken By') . ': {content}</div>';
         $content .= $element->render();
     }
     if (!DateTimeUtil::isDateTimeValueNull($this->model, 'dueDateTime')) {
         $element = new DateTimeElement($this->model, 'dueDateTime');
         $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Due') . ': {content}</div>';
         $content .= $element->render();
     }
     $date = '<span class="comment-details"><strong>' . DateTimeUtil::convertDbFormattedDateTimeToLocaleFormattedDisplay($this->model->createdDateTime, 'long', null) . '</strong></span>';
     $content .= $date;
     if ($this->model->files->count() > 0) {
         $element = new FilesElement($this->model, 'null');
         $element->nonEditableTemplate = '<div>{content}</div>';
         $content .= '<div><strong>' . Zurmo::t('MissionsModule', 'Attachments') . '</strong></div>';
         $content .= $element->render();
     }
     $element = new MissionStatusElement($this->model, 'status');
     $element->nonEditableTemplate = '<div class="comment-content">' . Zurmo::t('MissionsModule', 'Status') . ': {content}</div>';
     $content .= $element->render();
     $content .= '</div>';
     return ZurmoHtml::tag('div', array('id' => 'ModelDetailsSummaryView'), $content);
 }
コード例 #12
0
ファイル: AppendTask.php プロジェクト: kenguest/phing
 private function appendFooter($string)
 {
     $result = $string;
     if ($this->footer !== null) {
         $footer = $this->footer->getValue();
         if ($this->footer->filtering) {
             $fr = $this->getFilteredReader(new StringReader($footer));
             $footer = $fr->read();
         }
         $result = $string . $footer;
     }
     return $result;
 }
コード例 #13
0
 public function postRender()
 {
     $this->relativePage = $this->page;
     $this->isPostRendering = true;
     parent::render();
 }
 protected function renderTextElement(&$content, $attributeName, $template = null)
 {
     $element = new TextElement($this->model, $attributeName, $this->form);
     if (isset($template)) {
         $element->editableTemplate = $template;
     }
     $elementContent = $element->render();
     $this->wrapContentInTableRow($elementContent);
     $content .= $elementContent;
 }
コード例 #15
0
 protected function renderConfigurationFormLayout($form)
 {
     assert('$form instanceof ZurmoActiveForm');
     $content = null;
     if ($this->showFilteredBySearchTerm) {
         $element = new TextElement($this->configurationForm, 'filteredBySearchTerm', $form);
         $element->editableTemplate = ZurmoHtml::tag('div', array('id' => 'MarketingListMembersConfigurationForm_filteredBySearchTerm_area', 'class' => 'search-without-scope'), '{content}');
         $content .= $element->render();
     }
     if ($this->showFilteredBySubscriptionType) {
         $element = new MarketingListsSubscriptionTypeFilterRadioElement($this->configurationForm, 'filteredBySubscriptionType', $form);
         $element->editableTemplate = ZurmoHtml::tag('div', array('id' => 'MarketingListMembersConfigurationForm_filteredBySubscriptionType_area', 'class' => 'filters-bar'), '{content}');
         $content .= $element->render();
     }
     return $content;
 }
コード例 #16
0
 public function __construct($model, $attribute, $form = null, array $params = array())
 {
     assert('$model instanceof InstallSettingsForm');
     parent::__construct($model, $attribute, $form, $params);
 }
コード例 #17
0
ファイル: PhoneElement.php プロジェクト: youprofit/Zurmo
 protected function renderControlNonEditable()
 {
     return parent::renderControlNonEditable();
 }
コード例 #18
0
 /**
  * Override to support the 'title' from MyListForm being rendered into the view. This is special because this
  * view can be modified in the designer tool, however the MyListForm is not compatible with the SearchForm in
  * designer so this special override is in place to manually ensure the MyListForm attributes, currently only
  * 'title' can be placed.
  * @see DetailsView::afterResolveMetadataWithRenderedElements()
  */
 protected function afterResolveMetadataWithRenderedElements(&$metadataWithRenderedElements, $form)
 {
     assert('is_array($metadataWithRenderedElements)');
     assert('$form == null || $form instanceof ZurmoActiveForm');
     $element = new TextElement($this->model, 'title', $form);
     $titleData = array();
     $titleData['rows'][0]['cells'][0]['elements'][0] = $element->render();
     array_unshift($metadataWithRenderedElements['global']['panels'], $titleData);
 }
コード例 #19
0
 protected function renderFormAttributesContent()
 {
     $formType = $this->model->getFormType();
     $params = array('inputPrefix' => $this->inputPrefixData);
     $content = null;
     if ($formType == WorkflowEmailMessageRecipientForm::TYPE_DYNAMIC_TRIGGERED_MODEL_USER) {
         $dynamicUserTypeElement = new DynamicUserTypeForEmailMessageRecipientStaticDropDownElement($this->model, 'dynamicUserType', $this->form, $params);
         $dynamicUserTypeElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $content .= $dynamicUserTypeElement->render();
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_DYNAMIC_TRIGGERED_MODEL_RELATION_USER) {
         $relationElement = new ModelRelationForEmailMessageRecipientStaticDropDownElement($this->model, 'relation', $this->form, $params);
         $relationElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $dynamicUserTypeElement = new DynamicUserTypeForEmailMessageRecipientStaticDropDownElement($this->model, 'dynamicUserType', $this->form, $params);
         $dynamicUserTypeElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $allRelatedDropdowns = Zurmo::t('WorkflowsModule', '<span>For all related</span> {relationsDropDown}', array('{relationsDropDown}' => $relationElement->render()));
         $allRelatedDropdowns .= $dynamicUserTypeElement->render();
         $content .= ZurmoHtml::tag('div', array('class' => 'all-related-field'), $allRelatedDropdowns);
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_DYNAMIC_TRIGGERED_BY_USER || $formType == WorkflowEmailMessageRecipientForm::TYPE_DYNAMIC_TRIGGERED_MODEL) {
         //nothing to render
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_DYNAMIC_TRIGGERED_MODEL_RELATION) {
         $relationElement = new ModelRelationForEmailMessageRecipientStaticDropDownElement($this->model, 'relation', $this->form, $params);
         $relationElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $allRelatedDropdowns = Zurmo::t('WorkflowsModule', '<span>For all related</span> {relationsDropDown}', array('{relationsDropDown}' => $relationElement->render()));
         $content .= ZurmoHtml::tag('div', array('class' => 'all-related-field'), $allRelatedDropdowns);
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_STATIC_ADDRESS) {
         $toNameElement = new TextElement($this->model, 'toName', $this->form, $params);
         $toNameElement->editableTemplate = '<div class="value-data"><span>{label}</span>{content}{error}</div>';
         $toAddressElement = new TextElement($this->model, 'toAddress', $this->form, $params);
         $toAddressElement->editableTemplate = '<div class="value-data"><span>{label}</span>{content}{error}</div>';
         $toNameAndAddressElements = null;
         $toNameAndAddressElements .= $toNameElement->render();
         $toNameAndAddressElements .= $toAddressElement->render();
         $content .= ZurmoHtml::tag('div', array('class' => 'static-address-field'), $toNameAndAddressElements);
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_STATIC_GROUP) {
         $staticGroupElement = new AllGroupsStaticDropDownElement($this->model, 'groupId', $this->form, $params);
         $staticGroupElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $content .= $staticGroupElement->render();
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_STATIC_ROLE) {
         $staticRoleElement = new AllRolesStaticDropDownElement($this->model, 'roleId', $this->form, $params);
         $staticRoleElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $content .= $staticRoleElement->render();
     } elseif ($formType == WorkflowEmailMessageRecipientForm::TYPE_STATIC_USER) {
         $staticUserElement = new UserNameIdElement($this->model, 'userId', $this->form, $params);
         $staticUserElement->setIdAttributeId('userId');
         $staticUserElement->setNameAttributeName('stringifiedModelForValue');
         $staticUserElement->editableTemplate = '<div class="value-data">{content}{error}</div>';
         $content .= $staticUserElement->render();
     } else {
         throw new NotSupportedException();
     }
     return $content;
 }
コード例 #20
0
 /**
  * (non-PHPdoc)
  * @see Element::getHtmlOptions()
  */
 protected function getHtmlOptions()
 {
     $htmlOptions = array('class' => 'input-hint anyMixedAttributes-input', 'onfocus' => '$(this).select();', 'size' => 80);
     return array_merge(parent::getHtmlOptions(), $htmlOptions);
 }
コード例 #21
0
ファイル: testTab.php プロジェクト: airymvc/v3test
<?php

require_once dirname(__FILE__) . '/../zframework/app/library/ui/JsUIComponentInterface.php';
require_once dirname(__FILE__) . '/../zframework/app/library/ui/jquery/JUIComponent.php';
require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/UIComponent.php';
require_once dirname(__FILE__) . '/../zframework/app/library/ui/jquery/Tab.php';
require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/components/TextElement.php';
require_once dirname(__FILE__) . '/../zframework/app/library/ui/html/components/HtmlScript.php';
//put your code here
$sf = new Tab('test');
$sf->addTab("x1", "x1");
$sf->addTab("d1", "d1");
$e = new TextElement("xy");
$e->setAttribute("name", "dddddddd");
$e->setLabel('ddd', 'sdfdsfdsfs', 'css');
//$sf->setAttribute("id", "test");
//$sf->setAttribute("target", "_blank");
$sf->setElement("x1", $e);
$e1 = new HtmlScript();
$e1->setScript("<a herf='aa.html' target='_blank'>");
$sf->setElement('d1', $e1);
$e2 = new TextElement("xy1");
$e2->setAttribute("name", "dddddddd11");
$e2->setLabel('ddd', 'sdfdsfdsfs1', 'css1');
$sf->setElement("d1", $e2);
$e3 = new HtmlScript();
$e3->setScript("</a>");
$sf->setElement("d1", $e3);
echo $sf->render();
 protected function registerSendFromTypeChangeScript()
 {
     $inputPrefixData = $this->inputPrefixData;
     $sendFromTypeSelectId = EmailMessageSendFromTypeStaticDropDownElement::resolveInputIdPrefixIntoString(array_merge($inputPrefixData, array('sendFromType')));
     $sendFromNameId = TextElement::resolveInputIdPrefixIntoString(array_merge($inputPrefixData, array('sendFromName')));
     $sendFromAddressId = TextElement::resolveInputIdPrefixIntoString(array_merge($inputPrefixData, array('sendFromAddress')));
     Yii::app()->clientScript->registerScript('emailMessageSendFromTypeHelper' . $sendFromTypeSelectId, "\n                if (\$('#" . $sendFromTypeSelectId . "').val() == '" . EmailMessageForWorkflowForm::SEND_FROM_TYPE_DEFAULT . "' ||\n                    \$('#" . $sendFromTypeSelectId . "').val() == '" . EmailMessageForWorkflowForm::SEND_FROM_TYPE_TRIGGERED_MODEL_OWNER . "')\n                {\n                    \$('#" . $sendFromNameId . "').parentsUntil('tr').parent().hide();\n                    \$('#" . $sendFromAddressId . "').parentsUntil('tr').parent().hide();\n                }\n                \$('#" . $sendFromTypeSelectId . "').change( function()\n                    {\n                        if (\$(this).val() == '" . EmailMessageForWorkflowForm::SEND_FROM_TYPE_CUSTOM . "')\n                        {\n                    \$('#" . $sendFromNameId . "').parentsUntil('tr').parent().show();\n                    \$('#" . $sendFromAddressId . "').parentsUntil('tr').parent().show();\n                        }\n                        else\n                        {\n                            \$('#" . $sendFromNameId . "').val('');\n                            \$('#" . $sendFromNameId . "').parentsUntil('tr').parent().hide();\n                            \$('#" . $sendFromAddressId . "').val('');\n                            \$('#" . $sendFromAddressId . "').parentsUntil('tr').parent().hide();\n                        }\n                    }\n                );\n            ");
 }
コード例 #23
0
ファイル: TextTest.php プロジェクト: boyhagemann/form
 public function testTextElementHasDefaultView()
 {
     $this->assertSame('form::element.text', $this->element->getView());
 }
コード例 #24
0
 protected function renderLeftSideTopContent()
 {
     $content = null;
     $content .= '<div class="wide form">';
     $clipWidget = new ClipWidget();
     list($form, $formStart) = $clipWidget->renderBeginWidget('ZurmoActiveForm', array_merge(array('id' => static::getLeftSideFormId(), 'action' => '#'), $this->resolveActiveFormAjaxValidationOptions()));
     $content .= $formStart;
     $nameElement = new TextElement($this->getModel(), 'name', $form);
     $nameElement->editableTemplate = '{content}{error}';
     $content .= $nameElement->render();
     $descriptionElement = new TextAreaElement($this->getModel(), 'description', $form, array('rows' => 2));
     $content .= $descriptionElement->render();
     $formEnd = $clipWidget->renderEndWidget();
     $content .= $formEnd;
     $content .= $this->renderModalContainer();
     $content .= $this->renderAuditTrailModalContainer();
     $content .= '</div>';
     return ZurmoHtml::tag('div', array('class' => 'left-side-edit-view-panel'), $content);
 }
コード例 #25
0
ファイル: LoginForm.php プロジェクト: airymvc/airymvc2
 /**
  * Create the form object.
  * @param string $formAction
  * @param string $formId
  * @param string $formName
  * @param string $uidLabel
  * @param string $pwdLabel
  * @param string $moduleName
  * @param string $loginMsgId
  */
 protected function createForm($formAction, $formId, $formName, $uidLabel, $pwdLabel, $moduleName, $loginMsgId)
 {
     $acl = AclUtility::getInstance();
     $tblId = $acl->getTableIdByModule($moduleName);
     $mapFields = $acl->getMappingFieldByTbl($tblId);
     $uidField = $mapFields["user_id"];
     $pwdField = $mapFields["pwd"];
     //set form
     $this->setAttribute("id", $formName);
     $this->setAttribute("name", $formName);
     $this->setAttribute("class", $formName);
     $this->setAttribute("action", $formAction);
     //set form elements
     $uidTxtField = new TextElement($uidField);
     $pwdTxtField = new PasswordElement($pwdField);
     $submitBtn = new SubmitElement("submit");
     $messageDiv = new DivElement($loginMsgId);
     $uidTxtField->setLabel('uid', $uidLabel, 'uid');
     $uidTxtField->setAttribute('name', $uidField);
     $pwdTxtField->setLabel('pwd', $pwdLabel, 'pwd');
     $pwdTxtField->setAttribute('name', $pwdField);
     //set default form layout here
     if (is_null($this->_formDecoration)) {
         $this->_formDecoration = array($formId => array("<div class='{$formName}' name='{$formId}'>", "</div>"));
     }
     $this->setDecoration($this->_formDecoration);
     $this->setElement($uidTxtField);
     $this->setElement($pwdTxtField);
     $this->setElement($messageDiv);
     $this->setElement($submitBtn);
 }
コード例 #26
0
 /**
  * @param $webFormAttributeForm
  * @param $model
  * @param $attributeName
  * @param $attributeData
  * @return array
  */
 public static function resolvePlacedAttributeByName($webFormAttributeForm, $model, $attributeName, $attributeData)
 {
     $webFormAttributeForm->attribute = $attributeName;
     $params = array('inputPrefix' => array(get_class($webFormAttributeForm), $attributeName));
     if ($attributeData['isRequired']) {
         $webFormAttributeForm->required = true;
         $isRequiredChecked = 'checked';
         $isRequiredDisabled = 'disabled';
         $removePlacedAttributeLink = null;
     } else {
         if (isset($webFormAttributeForm->required) && $webFormAttributeForm->required == true) {
             $isRequiredChecked = 'checked';
             $isRequiredDisabled = null;
         } else {
             $isRequiredChecked = 'checked';
             $isRequiredDisabled = null;
         }
         $removePlacedAttributeLink = '<a class="remove-dynamic-row-link" id="ContactWebForm_serializedData_' . $attributeName . '" data-value="' . $attributeName . '"' . ' data-label="' . $attributeData['attributeLabel'] . '" href="#">—</a>';
     }
     if (isset($webFormAttributeForm->hidden) && $webFormAttributeForm->hidden == true) {
         $isHiddenChecked = 'checked';
         $hideHiddenAttributeElementStyle = 'display:block;';
     } else {
         $isHiddenChecked = '';
         $hideHiddenAttributeElementStyle = 'display:none;';
     }
     $attributeLabelElement = new TextElement($webFormAttributeForm, 'label', $model, $params);
     $isRequiredElement = new CheckBoxElement($webFormAttributeForm, 'required', $model, array_merge($params, array('checked' => $isRequiredChecked, 'disabled' => $isRequiredDisabled)));
     if (!in_array($attributeData['elementType'], static::$restrictHiddenControlAttributes)) {
         $isHiddenElement = new DerivedCheckBoxElement($webFormAttributeForm, 'hidden', $model, array_merge($params, array('checked' => $isHiddenChecked), array('htmlOptions' => array('class' => 'hiddenAttribute', 'data-value' => $attributeName))));
         $isHiddenElement->editableTemplate = '{content}{label}{error}';
         $renderHiddenAttributeElement = static::renderHiddenAttributeElement($webFormAttributeForm, 'hiddenValue', $model, $attributeData['elementType'], $params);
         $isHiddenElementContent = $isHiddenElement->render();
     } else {
         $isHiddenElementContent = null;
         $renderHiddenAttributeElement = null;
     }
     $attributeLabelElement->editableTemplate = '{content}{error}';
     $isRequiredElement->editableTemplate = '{content}{label}{error}';
     return array('{attributeName}' => $attributeName, '{attributeLabelElement}' => $attributeLabelElement->render(), '{isRequiredElement}' => $isRequiredElement->render(), '{isHiddenElement}' => $isHiddenElementContent, '{renderHiddenAttributeElement}' => $renderHiddenAttributeElement, '{removePlacedAttributeLink}' => $removePlacedAttributeLink, '{hideHiddenAttributeElementStyle}' => $hideHiddenAttributeElementStyle);
 }
コード例 #27
0
 public function getDataArray()
 {
     $output = parent::getDataArray();
     $output['type'] = "phone";
     return $output;
 }