本文整理汇总了PHP中Element::resolveInputNamePrefixIntoString方法的典型用法代码示例。如果您正苦于以下问题:PHP Element::resolveInputNamePrefixIntoString方法的具体用法?PHP Element::resolveInputNamePrefixIntoString怎么用?PHP Element::resolveInputNamePrefixIntoString使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Element
的用法示例。
在下文中一共展示了Element::resolveInputNamePrefixIntoString方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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);
}
示例2: resolveItemsAndContent
/**
* @return array
*/
protected function resolveItemsAndContent()
{
$items = array();
$inputName = Element::resolveInputNamePrefixIntoString(array('SavedWorkflow', 'savedWorkflowIds'));
foreach ($this->savedWorkflows as $workflow) {
$content = '<div class="dynamic-row">';
$content .= ZurmoHtml::hiddenField($inputName . '[]', $workflow->id);
$content .= strval($workflow);
$content .= '</div>';
$items[] = array('content' => $content);
}
return $items;
}
示例3: 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(FormModelUtil::RELATION_DELIMITER, $attributeIndexOrDerivedType)) > 1) {
$model = new $modelClassName(false);
$nestedAttributes = explode(FormModelUtil::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::resolveInputNamePrefixIntoString($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();
$form->id = "search-form";
$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;
}
示例4: 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);
}
示例5: 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);
}
}
示例6: 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;
}
示例7: 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);
}
示例8: 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;
}
}
示例9: 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);
}