本文整理汇总了PHP中Credentials::selectorField方法的典型用法代码示例。如果您正苦于以下问题:PHP Credentials::selectorField方法的具体用法?PHP Credentials::selectorField怎么用?PHP Credentials::selectorField使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Credentials
的用法示例。
在下文中一共展示了Credentials::selectorField方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
?>
<div class='email-inputs form'>
<div class="row">
<div id="inline-email-errors" class="error" style="display:none"></div>
<?php
echo $form->errorSummary($this->model, Yii::t('app', "Please fix the following errors:"), null);
?>
</div>
<div class="row email-input-row credId-row"
<?php
echo $this->hideFromField ? 'style="display: none;"' : '';
?>
>
<?php
echo $form->label($this->model, 'credId', array('class' => 'credId-label x2-email-label'));
echo Credentials::selectorField($this->model, 'credId');
?>
</div>
<div class='addressee-rows'>
<div class="row email-input-row email-to-row show-input-name">
<?php
//echo $form->label($this->model, 'to', array('class' => 'x2-email-label'));
echo $form->textField($this->model, 'to', array('id' => 'email-to', 'class' => 'x2-default-field', 'data-default-text' => CHtml::encode(Yii::t('app', 'Addressees')), 'tabindex' => '1'));
?>
<div class='toggle-container'>
<a href="javascript:void(0)"
id="cc-toggle"<?php
if (!empty($this->model->cc)) {
echo ' style="display:none;"';
}
?>
示例2: renderModelInput
//.........这里部分代码省略.........
label += "<span style=\\"font-size: 0.6em;\\">";
// add email if defined
if(item.subject) {
label += "<br>";
label += item.subject;
}
label += "</span>";
label += "</a>";
return $( "<li>" )
.data( "item.autocomplete", item )
.append( label )
.appendTo( ul );
};
}' : '')), 'htmlOptions' => array_merge(array('title' => $field->attributeLabel), $htmlOptions)), true);
if (isset($oldLinkFieldVal)) {
$model->{$fieldName} = $oldLinkFieldVal;
}
return $input;
case 'rating':
return Yii::app()->controller->widget('X2StarRating', array('model' => $model, 'attribute' => $field->fieldName, 'readOnly' => isset($htmlOptions['disabled']) && $htmlOptions['disabled'], 'minRating' => Fields::RATING_MIN, 'maxRating' => Fields::RATING_MAX, 'starCount' => Fields::RATING_MAX - Fields::RATING_MIN + 1, 'cssFile' => Yii::app()->theme->getBaseUrl() . '/css/rating/jquery.rating.css', 'htmlOptions' => $htmlOptions, 'callback' => 'function(value, link){
if (typeof x2 !== "undefined" &&
typeof x2.InlineEditor !== "undefined" &&
typeof x2.InlineEditor.ratingFields !== "undefined") {
x2.InlineEditor.ratingFields["' . $field->modelName . '[' . $field->fieldName . ']"] = value;
}
}'), true);
case 'boolean':
$checkbox = CHtml::openTag('div', X2Html::mergeHtmlOptions($htmlOptions, array('class' => 'checkboxWrapper')));
$checkbox .= CHtml::activeCheckBox($model, $field->fieldName, array_merge(array('unchecked' => 0, 'title' => $field->attributeLabel), $htmlOptions));
$checkbox .= CHtml::closeTag('div');
return $checkbox;
case 'assignment':
$oldAssignmentVal = $model->{$fieldName};
$model->{$fieldName} = !empty($model->{$fieldName}) ? $field->linkType == 'multiple' && !is_array($model->{$fieldName}) ? explode(', ', $model->{$fieldName}) : $model->{$fieldName} : X2Model::getDefaultAssignment();
$dropdownList = CHtml::activeDropDownList($model, $fieldName, X2Model::getAssignmentOptions(true, true), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . '_' . $fieldName . '_assignedToDropdown', 'multiple' => $field->linkType == 'multiple' ? 'multiple' : null), $htmlOptions));
$model->{$fieldName} = $oldAssignmentVal;
return $dropdownList;
case 'optionalAssignment':
// optional assignment for users (can be left blank)
$users = User::getNames();
unset($users['Anyone']);
return CHtml::activeDropDownList($model, $fieldName, $users, array_merge(array('title' => $field->attributeLabel, 'empty' => ''), $htmlOptions));
case 'visibility':
$permissionsBehavior = Yii::app()->params->modelPermissions;
return CHtml::activeDropDownList($model, $field->fieldName, $permissionsBehavior::getVisibilityOptions(), array_merge(array('title' => $field->attributeLabel, 'id' => $field->modelName . "_visibility"), $htmlOptions));
// 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
// case 'int':
// return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
// 'title' => $field->attributeLabel,
// ), $htmlOptions));
// 'varchar', 'email', 'url', 'int', 'float', 'currency', 'phone'
// case 'int':
// return CHtml::activeNumberField($model, $field->fieldNamearray_merge(array(
// 'title' => $field->attributeLabel,
// ), $htmlOptions));
case 'percentage':
$htmlOptions['class'] = empty($htmlOptions['class']) ? 'input-percentage' : $htmlOptions['class'] . ' input-percentage';
return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
case 'currency':
$fieldName = $field->fieldName;
$elementId = isset($htmlOptions['id']) ? '#' . $htmlOptions['id'] : '#' . $field->modelName . '_' . $field->fieldName;
Yii::app()->controller->widget('application.extensions.moneymask.MMask', array('element' => $elementId, 'currency' => Yii::app()->params['currency'], 'config' => array('affixStay' => true, 'decimal' => Yii::app()->locale->getNumberSymbol('decimal'), 'thousands' => Yii::app()->locale->getNumberSymbol('group'))));
return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel, 'class' => 'currency-field'), $htmlOptions));
case 'credentials':
$typeAlias = explode(':', $field->linkType);
$type = $typeAlias[0];
if (count($typeAlias) > 1) {
$uid = Credentials::$sysUseId[$typeAlias[1]];
} else {
$uid = Yii::app()->user->id;
}
return Credentials::selectorField($model, $field->fieldName, $type, $uid);
case 'timerSum':
// Sorry, no-can-do. This is field derives its value from a sum over timer records.
return $model->renderAttribute($field->fieldName);
case 'float':
case 'int':
if (isset($model->{$fieldName})) {
$oldNumVal = $model->{$fieldName};
$model->{$fieldName} = Yii::app()->locale->numberFormatter->formatDecimal($model->{$fieldName});
}
$input = CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
if (isset($oldNumVal)) {
$model->{$fieldName} = $oldNumVal;
}
return $input;
default:
return CHtml::activeTextField($model, $field->fieldName, array_merge(array('title' => $field->attributeLabel), $htmlOptions));
// array(
// 'tabindex'=>isset($item['tabindex'])? $item['tabindex'] : null,
// 'disabled'=>$item['readOnly']? 'disabled' : null,
// 'title'=>$field->attributeLabel,
// 'style'=>$default?'color:#aaa;':null,
// ));
}
}
示例3: array
<br /><hr />
<h4><?php
echo Yii::t('admin', 'Service Case Email Settings');
?>
</h4>
<p><?php
echo Yii::t('admin', 'Configure how X2Engine sends email when responding to new service case requests.');
?>
</p>
<div class="row">
<div class="cell">
<?php
echo $form->labelEx($model, 'serviceCaseEmailAccount');
?>
<?php
echo Credentials::selectorField($model, 'serviceCaseEmailAccount', 'email', Credentials::$sysUseId['serviceCaseEmail'], array('class' => 'email-selector', 'id' => 'email-selector-servicecase'));
?>
</div>
</div>
<div class="row email-selector-servicecase-legacy">
<div class="cell">
<?php
echo $form->labelEx($model, 'serviceCaseFromEmailName');
?>
<?php
echo $form->textField($model, 'serviceCaseFromEmailName', array('size' => 30));
?>
</div>
<div class="cell">
<?php
echo $form->labelEx($model, 'serviceCaseFromEmailAddress');