当前位置: 首页>>代码示例>>PHP>>正文


PHP Element::resolveInputIdPrefixIntoString方法代码示例

本文整理汇总了PHP中Element::resolveInputIdPrefixIntoString方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::resolveInputIdPrefixIntoString方法的具体用法?PHP Element::resolveInputIdPrefixIntoString怎么用?PHP Element::resolveInputIdPrefixIntoString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Element的用法示例。


在下文中一共展示了Element::resolveInputIdPrefixIntoString方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: renderMergeTagsContent

 protected function renderMergeTagsContent()
 {
     $title = ZurmoHtml::tag('h3', array(), Zurmo::t('Default', 'Merge Tags'));
     $view = new MergeTagsView('Campaign', Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'textContent')), Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'htmlContent')), false);
     $content = $view->render();
     return $title . $content;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:7,代码来源:CampaignEditView.php

示例2: renderAttributeIndexOrDerivedType

 /**
  * @return string
  */
 protected function renderAttributeIndexOrDerivedType()
 {
     $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('attributeIndexOrDerivedType')));
     $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('attributeIndexOrDerivedType')));
     $idInputHtmlOptions = array('id' => $hiddenInputId);
     return ZurmoHtml::hiddenField($hiddenInputName, $this->model->getAttributeIndexOrDerivedType(), $idInputHtmlOptions);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:RuntimeReportAttributeToElementAdapter.php

示例3: resolveId

 protected function resolveId($model, $attribute)
 {
     $id = CHtml::activeId($model, $attribute);
     if ($this->inputPrefixData == null) {
         return $id;
     }
     $inputIdPrefix = Element::resolveInputIdPrefixIntoString($this->inputPrefixData);
     return str_replace(get_class($model), $inputIdPrefix, $id);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:9,代码来源:WizardActiveForm.php

示例4: registerStageToProbabilityMappingScript

 protected function registerStageToProbabilityMappingScript($form)
 {
     $stageInputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'stage', 'value'));
     $probabilityInputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'probability'));
     $mappingData = OpportunitiesModule::getStageToProbabilityMappingData();
     if (count($mappingData) > 0) {
         $jsonEncodedMapping = CJSON::encode($mappingData);
         Yii::app()->clientScript->registerScript('stageToProbabilityMapping', "\n                \$('#" . $stageInputId . "').unbind('change');\n                \$('#" . $stageInputId . "').bind('change', function()\n                    {\n                        stageToProbabilityMapping(\$(this));\n                    }\n                );\n                function stageToProbabilityMapping(stageInput)\n                {\n                    var value  = stageInput.val();\n                    var result = \$.parseJSON('" . $jsonEncodedMapping . "');\n                    \$('#" . $probabilityInputId . "').val(0);\n                    \$.each(result, function(stage, probability)\n                    {\n                        if (value == stage)\n                        {\n                            \$('#" . $probabilityInputId . "').val(probability);\n                            return false;\n                        }\n                    });\n                 }\n                 stageToProbabilityMapping(\$('#" . $stageInputId . "'));\n                ");
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:10,代码来源:OpportunityEditAndDetailsView.php

示例5: registerSetMeetingEndDateTimeScript

 protected function registerSetMeetingEndDateTimeScript($form)
 {
     $url = Yii::app()->createUrl($this->moduleId . '/' . $this->controllerId . '/getMeetingEndDateTimeBasedOnStartDateTime');
     $meetingStartDateTimeId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'startDateTime'));
     $meetingEndDateTimeId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'endDateTime'));
     // Fill endDateTime only for new meetings
     if ($this->model->id <= 0) {
         // Begin Not Coding Standard
         Yii::app()->clientScript->registerScript('SetMeetingEndDateTime', "\n                    \$('#" . $meetingStartDateTimeId . "').change(function()\n                    {\n                        \$.ajax(\n                        {\n                            url : '" . $url . "',\n                            type : 'GET',\n                            data : {\n                                startDateTime : \$('#" . $meetingStartDateTimeId . "').val()\n                            },\n                            dataType: 'json',\n                            success : function(data)\n                            {\n                                if (data['endDateTime'] && data['endDateTime'].length > 0)\n                                {\n                                    \$('#" . $meetingEndDateTimeId . "').val(data['endDateTime']);\n                                }\n                            },\n                            error : function()\n                            {\n                            }\n                        }\n                        );\n                    });\n                ");
         // End Not Coding Standard
     }
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info,代码行数:12,代码来源:MeetingEditAndDetailsView.php

示例6: registerStageToProbabilityMappingScript

 protected function registerStageToProbabilityMappingScript($form)
 {
     $stageInputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'stage', 'value'));
     $probabilityInputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), 'probability'));
     $mappingData = ContractsModule::getStageToProbabilityMappingData();
     if (count($mappingData) > 0) {
         $jsonEncodedMapping = CJSON::encode($mappingData);
         // In case of edit, we need the exact value from db
         if ($this->model->id > 0) {
             $initialCallToFunction = "";
         } else {
             $initialCallToFunction = " stageToProbabilityMapping(\$('#" . $stageInputId . "'));";
         }
         Yii::app()->clientScript->registerScript('stageToProbabilityMapping', "\n                \$('#" . $stageInputId . "').unbind('change.probabilityMapping');\n                \$('#" . $stageInputId . "').bind('change.probabilityMapping', function()\n                    {\n                        stageToProbabilityMapping(\$(this));\n                    }\n                );\n                function stageToProbabilityMapping(stageInput)\n                {\n                    var value  = stageInput.val();\n                    var result = \$.parseJSON('" . $jsonEncodedMapping . "');\n                    \$('#" . $probabilityInputId . "').val(0);\n                    \$.each(result, function(stage, probability)\n                    {\n                        if (value == stage)\n                        {\n                            \$('#" . $probabilityInputId . "').val(probability);\n                            return false;\n                        }\n                    });\n                 }\n                 " . $initialCallToFunction);
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:16,代码来源:ContractEditAndDetailsView.php

示例7: renderHiddenStructurePositionInput

 /**
  * @return string
  */
 protected function renderHiddenStructurePositionInput()
 {
     $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('structurePosition')));
     $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('structurePosition')));
     $idInputHtmlOptions = array('id' => $hiddenInputId, 'class' => 'structure-position');
     return ZurmoHtml::hiddenField($hiddenInputName, $this->rowNumber + 1, $idInputHtmlOptions);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:AttributeRowForWizardModelComponentView.php

示例8: getInputIdForDedupe

 /**
  * Returns the input id that should be used to trigger the dedupe
  * @param Element $element
  * @return null|string
  */
 protected function getInputIdForDedupe(Element $element)
 {
     $interfaces = class_implements($element);
     if (in_array('MultipleAttributesElementInterface', $interfaces)) {
         return Element::resolveInputIdPrefixIntoString(array(get_class($this->model), $element->getAttribute(), $this->getRelatedAttributeForDedupe($element)));
     } else {
         return Element::resolveInputIdPrefixIntoString(array(get_class($this->model), $this->getAttributeForDedupe($element)));
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:14,代码来源:DedupeRules.php

示例9: renderHiddenOperator

 /**
  * Builds hidden operator input. Used in the event there is only one operator available. No reason to show
  * that in the user interface
  * @return string
  */
 protected function renderHiddenOperator()
 {
     if ($this->model->hasAvailableOperatorsType() && count($this->model->getOperatorValuesAndLabels()) == 1) {
         $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('operator')));
         $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('operator')));
         $idInputHtmlOptions = array('id' => $hiddenInputId);
         $valuesAndLabels = $this->model->getOperatorValuesAndLabels();
         return ZurmoHtml::hiddenField($hiddenInputName, key($valuesAndLabels), $idInputHtmlOptions);
     }
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:15,代码来源:ReportAttributeToElementAdapter.php

示例10: renderHiddenRecipientsInputForValidationContent

 /**
  * @return string
  */
 protected function renderHiddenRecipientsInputForValidationContent()
 {
     $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('recipientsValidation')));
     $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('recipientsValidation')));
     $idInputHtmlOptions = array('id' => $hiddenInputId);
     $id = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('recipientsValidation')));
     $content = ZurmoHtml::hiddenField($hiddenInputName, null, $idInputHtmlOptions);
     $content .= $this->form->error($this->model, 'recipientsValidation', array('inputID' => $hiddenInputId), true, true, $id);
     return $content;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:13,代码来源:EmailMessageRowForWorkflowComponentView.php

示例11: renderRelatedModelRelationHiddenInputContent

 /**
  * @return string
  */
 protected function renderRelatedModelRelationHiddenInputContent()
 {
     $hiddenInputName = Element::resolveInputNamePrefixIntoString(array_merge($this->inputPrefixData, array('relatedModelRelation')));
     $hiddenInputId = Element::resolveInputIdPrefixIntoString(array_merge($this->inputPrefixData, array('relatedModelRelation')));
     $idInputHtmlOptions = array('id' => $hiddenInputId);
     return ZurmoHtml::hiddenField($hiddenInputName, $this->model->relatedModelRelation, $idInputHtmlOptions);
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:10,代码来源:ActionRowForWorkflowComponentView.php

示例12: renderTypeContent

 /**
  * @return A|string
  */
 protected function renderTypeContent()
 {
     $typeValuesAndLabels = $this->model->getTypeValuesAndLabels($this->isCreatingNewModel(), $this->isAttributeRequired);
     if (count($typeValuesAndLabels) > 1) {
         $params = array('inputPrefix' => $this->inputPrefixData, 'typeValuesAndLabels' => $typeValuesAndLabels);
         $typeElement = new WorkflowActionAttributeTypeStaticDropDownElement($this->model, 'type', $this->form, $params);
         $typeElement->editableTemplate = '{content}{error}';
         return $typeElement->render();
     } else {
         $label = reset($typeValuesAndLabels);
         $name = Element::resolveInputNamePrefixIntoString($this->inputPrefixData) . '[type]';
         $id = Element::resolveInputIdPrefixIntoString($this->inputPrefixData) . 'type';
         $htmlOptions = array('id' => $id);
         $content = ZurmoHtml::tag('span', array(), $label);
         $content .= ZurmoHtml::hiddenField($name, key($typeValuesAndLabels), $htmlOptions);
         return $content;
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:21,代码来源:WorkflowActionAttributeToElementAdapter.php

示例13: renderTypeContent

 protected function renderTypeContent()
 {
     $name = Element::resolveInputNamePrefixIntoString($this->inputPrefixData) . '[type]';
     $id = Element::resolveInputIdPrefixIntoString($this->inputPrefixData) . 'type';
     $htmlOptions = array('id' => $id);
     return ZurmoHtml::hiddenField($name, $this->emailMessageRecipientType, $htmlOptions);
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:7,代码来源:WorkflowEmailMessageRecipientToElementAdapter.php

示例14: resolveInputId

 /**
  * Resolves input id for the attribute
  * @param string $attribute
  * @param string $relatedAttribute
  * @return string
  */
 private function resolveInputId($attribute, $relatedAttribute = null)
 {
     assert('is_string($attribute)');
     assert('is_string($relatedAttribute) || ($relatedAttribute === null)');
     if ($this->model->{$attribute} instanceof CustomField) {
         $inputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), $attribute, 'value'));
     } elseif ($relatedAttribute != null) {
         $inputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), $attribute, $relatedAttribute));
     } else {
         $inputId = Element::resolveInputIdPrefixIntoString(array(get_class($this->model), $attribute));
     }
     return $inputId;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:19,代码来源:ModelAttributeAndElementDataToMergeItem.php

示例15: renderDynamicSearchAttributeInput

 public static function renderDynamicSearchAttributeInput($viewClassName, $modelClassName, $formModelClassName, $rowNumber, $attributeIndexOrDerivedType, $searchAttributes = array(), $suffix = null)
 {
     assert('is_string($viewClassName)');
     assert('is_string($modelClassName)');
     assert('is_string($formModelClassName)');
     assert('is_int($rowNumber)');
     assert('is_string($attributeIndexOrDerivedType) || $attributeIndexOrDerivedType == null');
     assert('is_array($searchAttributes)');
     assert('is_string($suffix) || $suffix == null');
     $content = null;
     if (count(explode(DynamicSearchUtil::RELATION_DELIMITER, $attributeIndexOrDerivedType)) > 1) {
         $model = new $modelClassName(false);
         $nestedAttributes = explode(DynamicSearchUtil::RELATION_DELIMITER, $attributeIndexOrDerivedType);
         $inputPrefix = array($formModelClassName, DynamicSearchForm::DYNAMIC_NAME, $rowNumber);
         $totalNestedCount = count($nestedAttributes);
         $processCount = 1;
         $nestedSearchAttributes = $searchAttributes;
         foreach ($nestedAttributes as $attribute) {
             if ($processCount < $totalNestedCount && isset($nestedSearchAttributes[$attribute])) {
                 $nestedSearchAttributes = $nestedSearchAttributes[$attribute];
                 if (isset($nestedSearchAttributes['relatedData'])) {
                     unset($nestedSearchAttributes['relatedData']);
                 }
             }
             if ($processCount < $totalNestedCount) {
                 $model = SearchUtil::resolveModelToUseByModelAndAttributeName($model, $attribute);
                 $inputPrefix[] = $attribute;
                 $relatedDataName = Element::resolveInputIdPrefixIntoString($inputPrefix) . '[relatedData]';
                 $content .= ZurmoHtml::hiddenField($relatedDataName, true);
             }
             $processCount++;
         }
         $attributeIndexOrDerivedType = $attribute;
         $modelToUse = $model;
         $modelToUse->setAttributes($nestedSearchAttributes);
         $cellElementModelClassName = get_class($model->getModel());
         //Dynamic Search needs to always assume there is an available SearchForm
         //Always assumes the SearchView to use matches the exact pluralCamelCasedName.
         //Does not support nested relations to leads persay.  It will resolve as a Contact.
         //This is not a problem since you can't relate a model to a lead, it is related to a contact.
         //So this scenario would not come up naturally.
         $moduleClassName = $model->getModel()->getModuleClassName();
         $viewClassName = $moduleClassName::getPluralCamelCasedName() . 'SearchView';
         $element = DynamicSearchUtil::getCellElement($viewClassName, $cellElementModelClassName, $attributeIndexOrDerivedType);
     } else {
         $model = new $modelClassName(false);
         $model->setScenario('importModel');
         //this is so attributes such as modified user can be set
         $modelToUse = new $formModelClassName($model);
         $modelToUse->setAttributes($searchAttributes);
         $inputPrefix = array($formModelClassName, DynamicSearchForm::DYNAMIC_NAME, $rowNumber);
         $element = DynamicSearchUtil::getCellElement($viewClassName, $modelClassName, $attributeIndexOrDerivedType);
     }
     $form = new NoRequiredsActiveForm();
     $element['inputPrefix'] = $inputPrefix;
     $elementclassname = $element['type'] . 'Element';
     $element = new $elementclassname($modelToUse, $element['attributeName'], $form, array_slice($element, 2));
     $element->editableTemplate = '{content}{error}';
     $content .= $element->render();
     DropDownUtil::registerScripts(CClientScript::POS_END);
     return $content;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:62,代码来源:DynamicSearchUtil.php


注:本文中的Element::resolveInputIdPrefixIntoString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。