本文整理汇总了PHP中X2Html类的典型用法代码示例。如果您正苦于以下问题:PHP X2Html类的具体用法?PHP X2Html怎么用?PHP X2Html使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了X2Html类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: getSortLinks
public static function getSortLinks($order = null)
{
$ret = X2Html::link(Yii::t('topics', 'Sorting'), '#', array('id' => 'topics-sort-toggle', 'class' => 'x2-button', 'style' => 'vertical-align:top;'));
$links = array(X2Html::link(Yii::t('topics', 'Most Recent'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'mostRecent')), array('class' => 'x2-button' . ($order == 'mostRecent' || is_null($order) ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Alphabetical'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'alphabetical')), array('class' => 'x2-button' . ($order == 'alphabetical' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Create Date'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'firstCreated')), array('class' => 'x2-button' . ($order == 'firstCreated' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')), X2Html::link(Yii::t('topics', 'Most Popular'), Yii::app()->controller->createUrl('/topics/topics/index', array('order' => 'mostPopular')), array('class' => 'x2-button' . ($order == 'mostPopular' ? ' disabled disabled-link' : ''), 'style' => 'vertical-align:top;')));
$ret .= X2Html::tag('div', array('id' => 'topics-sort-buttons', 'style' => 'display:none;'), implode(' ', $links));
return $ret;
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:7,代码来源:Topics.php
示例2: getViewActionMenuListItem
public static function getViewActionMenuListItem($modelId)
{
if (Yii::app()->controller->action->getId() === 'view') {
return array('name' => 'view', 'label' => Yii::t('app', 'View') . X2Html::minimizeButton(array('class' => 'record-view-type-menu-toggle'), '#record-view-type-menu', true, Yii::app()->params->profile->miscLayoutSettings['viewModeActionSubmenuOpen']), 'encodeLabel' => false, 'url' => array('view', 'id' => $modelId), 'linkOptions' => array('onClick' => '$(this).find ("i:visible").click ();'), 'itemOptions' => array('id' => 'view-record-action-menu-item'), 'submenuOptions' => array('id' => 'record-view-type-menu', 'style' => Yii::app()->params->profile->miscLayoutSettings['viewModeActionSubmenuOpen'] ? '' : 'display: none;'), 'items' => array(array('encodeLabel' => false, 'name' => 'journalView', 'label' => CHtml::checkBox('journalView', Yii::app()->params->profile->miscLayoutSettings['enableJournalView'], array('class' => 'journal-view-checkbox')) . CHtml::label(Yii::t('app', 'Journal View'), 'journalView')), array('encodeLabel' => false, 'name' => 'transactionalView', 'label' => CHtml::checkBox('transactionalView', Yii::app()->params->profile->miscLayoutSettings['enableTransactionalView'], array('class' => 'transactional-view-checkbox')) . CHtml::label(Yii::t('app', 'List View'), 'transactionalView'))));
} else {
return array('name' => 'view', 'label' => Yii::t('app', 'View'), 'encodeLabel' => true, 'url' => array('view', 'id' => $modelId));
}
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:8,代码来源:RecordViewLayoutManager.php
示例3: renderInput
public function renderInput(CModel $model, $attribute, array $htmlOptions = array())
{
$action = new Actions();
$action->setAttributes($model->getAttributes(), false);
$defaultOptions = array('id' => $this->resolveId($attribute));
$htmlOptions = X2Html::mergeHtmlOptions($defaultOptions, $htmlOptions);
return preg_replace('/Actions(\\[[^\\]]*\\])/', get_class($this->formModel) . '$1', $action->renderInput($attribute, $htmlOptions));
}
开发者ID:shuvro35,项目名称:X2CRM,代码行数:8,代码来源:ActionActiveFormBase.php
示例4: getLink
public function getLink()
{
if ($this->type === 'folder') {
return X2Html::link($this->name, '#', array('class' => 'folder-link pseudo-link', 'data-id' => $this->objId));
} else {
return X2Html::link($this->name, Yii::app()->controller->createUrl('/docs/view', array('id' => $this->objId)));
}
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:8,代码来源:FileSystemObject.php
示例5: run
public function run()
{
$this->htmlOptions = X2Html::mergeHtmlOptions($this->htmlOptions, array('id' => $this->namespace . "-multi-type-autocomplete-container"));
if (isset($this->model)) {
$selectAttr = $this->selectName;
$this->selectValue = $this->model->{$selectAttr};
}
$this->render('_multiTypeAutocomplete');
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:9,代码来源:MultiTypeAutocomplete.php
示例6: getGridViewConfig
/**
* @return array the config array passed to widget ()
*/
public function getGridViewConfig()
{
if (!isset($this->_gridViewConfig)) {
$this->_gridViewConfig = array_merge(parent::getGridViewConfig(), array('possibleResultsPerPage' => array(5, 10, 20, 30, 40, 50, 75, 100), 'defaultGvSettings' => array('isActive' => 65, 'fullName' => 125, 'lastLogin' => 80, 'emailAddress' => 100), 'template' => CHtml::openTag('div', X2Html::mergeHtmlOptions(array('class' => 'page-title'), array('style' => !CPropertyValue::ensureBoolean($this->getWidgetProperty('showHeader')) && !CPropertyValue::ensureBoolean($this->getWidgetProperty('hideFullHeader')) ? 'display: none;' : ''))) . '<h2 class="grid-widget-title-bar-dummy-element">' . '</h2>{buttons}{filterHint}' . '{summary}{topPager}</div>{items}{pager}', 'includedFields' => array('tagLine', 'username', 'officePhone', 'cellPhone', 'emailAddress', 'googleId', 'isActive', 'leadRoutingAvailability'), 'specialColumns' => array('fullName' => array('name' => 'fullName', 'header' => Yii::t('profile', 'Full Name'), 'value' => 'CHtml::link(CHtml::encode($data->fullName),array("view","id"=>$data->id))', 'type' => 'raw'), 'lastLogin' => array('name' => 'lastLogin', 'header' => Yii::t('profile', 'Last Login'), 'value' => '$data->user ? ($data->user->lastLogin == 0 ? "" : ' . 'Formatter::formatDateDynamic ($data->user->lastLogin)) : ""', 'type' => 'raw'), 'isActive' => array('name' => 'isActive', 'header' => Yii::t('profile', 'Active'), 'value' => '"<span title=\'' . '".(Session::isOnline ($data->username) ? ' . '"' . Yii::t('profile', 'Active User') . '" : "' . Yii::t('profile', 'Inactive User') . '")."\'' . ' class=\'".(Session::isOnline ($data->username) ? ' . '"active-indicator" : "inactive-indicator")."\'></span>"', 'type' => 'raw'), 'username' => array('name' => 'username', 'header' => Yii::t('profile', 'Username'), 'value' => '$data->user ? CHtml::encode($data->user->alias) : ""', 'type' => 'raw'), 'leadRoutingAvailability' => array('name' => 'leadRoutingAvailability', 'header' => Yii::t('profile', 'Lead Routing Availability'), 'value' => 'CHtml::encode($data->leadRoutingAvailability ?
Yii::t("profile", "Available") :
Yii::t("profile", "Unavailable"))', 'type' => 'raw')), 'enableControls' => false));
}
return $this->_gridViewConfig;
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:12,代码来源:ProfilesGridViewProfileWidget.php
示例7: quickNoteSelector
public function quickNoteSelector(CFormModel $formModel)
{
ob_start();
ob_implicit_flush(false);
echo CHtml::label(Yii::t('app', 'Quick Note'), 'quickNote', array('style' => 'display:inline-block; margin-right: 10px;'));
echo X2Html::dropDownList('quickNote', '', array_merge(array('' => '-'), Dropdowns::getItems(117)), array('ajax' => array('type' => 'GET', 'url' => Yii::app()->controller->createUrl('/site/dynamicDropdown'), 'data' => 'js:{"val":$(this).val(),"dropdownId":"117"}', 'update' => $this->resolveIds('#quickNote2')), 'id' => $this->resolveId('quickNote'), 'class' => 'quick-note'));
echo X2Html::dropDownList('quickNote2', '', array('' => '-'), array('id' => $this->resolveId('quickNote2'), 'class' => 'quick-note'));
Yii::app()->clientScript->registerScript('quickNoteSelector', "\n \$('#{$this->resolveId('quickNote2')}').change (function () {\n \$(this).next ().val (\$(this).val ());\n });\n ");
return ob_get_clean();
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:10,代码来源:CallActiveForm.php
示例8: renderInput
public function renderInput($attr)
{
switch ($attr) {
case 'password':
echo X2Html::x2ActivePasswordField($this, $attr, $this->htmlOptions($attr), true);
break;
default:
parent::renderInput($attr);
}
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:10,代码来源:MandrillAccount.php
示例9: generateColumns
protected function generateColumns()
{
$unsortedColumns = array();
foreach ($this->columns as &$column) {
$name = isset($column['name']) ? $column['name'] : '';
if (!isset($column['id'])) {
if (isset($column['class']) && is_subclass_of($column['class'], 'CCheckboxColumn')) {
$column['id'] = $this->namespacePrefix . 'C_gvCheckbox' . $name;
} else {
$column['id'] = $this->namespacePrefix . 'C_' . $name;
}
} else {
$column['id'] = $this->namespacePrefix . $column['id'];
}
if (!isset($this->gvSettings[$name])) {
if ($name === 'gvCheckbox') {
$column = $this->getGvCheckboxColumn(null, $column);
}
$unsortedColumns[] = $column;
continue;
}
$width = $this->gvSettings[$name];
$width = $this->formatWidth($width);
if ($width) {
$column['headerHtmlOptions'] = array_merge(isset($column['headerHtmlOptions']) ? $column['headerHtmlOptions'] : array(), array('style' => 'width:' . $width . ';'));
$column['htmlOptions'] = X2Html::mergeHtmlOptions(isset($column['htmlOptions']) ? $column['htmlOptions'] : array(), array('width' => $width));
}
}
unset($column);
// unset lingering reference
if (isset($this->gvSettings['gvControls']) && $this->enableControls) {
$width = $this->gvSettings['gvControls'];
$width = !empty($width) && is_numeric($width) ? $width : null;
$this->columns[] = $this->getGvControlsColumn($width);
}
if (isset($this->gvSettings['gvCheckBox'])) {
$width = $this->gvSettings['gvCheckBox'];
$width = !empty($width) && is_numeric($width) ? $width : null;
$this->columns[] = $this->getGvCheckboxColumn($width);
}
if ($this->rememberColumnSort) {
$sortedColumns = array();
foreach ($this->gvSettings as $columnName => $width) {
foreach ($this->columns as $column) {
$name = isset($column['name']) ? $column['name'] : '';
if ($name === $columnName) {
$sortedColumns[] = $column;
break;
}
}
}
$this->columns = array_merge($sortedColumns, $unsortedColumns);
}
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:54,代码来源:X2GridViewGeneric.php
示例10: renderDateTime
protected function renderDateTime($field, $makeLinks, $textOnly, $encode)
{
$fieldName = $field->fieldName;
if (empty($this->owner->{$fieldName})) {
return ' ';
} elseif (is_numeric($this->owner->{$fieldName})) {
return X2Html::dynamicDate($this->owner->{$fieldName});
} else {
return $this->render($this->owner->{$fieldName}, $encode);
}
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:11,代码来源:TransactionalViewFieldFormatter.php
示例11: renderFilterCellByType
public function renderFilterCellByType()
{
$model = $this->grid->filter;
switch ($this->filterType) {
case 'date':
return X2Html::activeDatePicker($model, $this->name);
break;
case 'dateTime':
return X2Html::activeDatePicker($model, $this->name, array(), 'datetime');
break;
}
}
开发者ID:keyeMyria,项目名称:CRM,代码行数:12,代码来源:X2DataColumnGeneric.php
示例12: renderInput
public function renderInput($attr)
{
switch ($attr) {
case 'password':
echo X2Html::x2ActivePasswordField($this, $attr, $this->htmlOptions($attr), true);
break;
case 'server':
echo CHtml::activeDropDownList($this, 'server', $this->sesEndpoints, $this->htmlOptions($attr));
break;
default:
parent::renderInput($attr);
}
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:13,代码来源:SESAccount.php
示例13: render
public function render()
{
if ($this->isSelected) {
$this->htmlOptions = X2Html::mergeHtmlOptions($this->htmlOptions, array('class' => 'selected'));
}
$html = CHtml::openTag('li', $this->htmlOptions);
$html .= CHtml::openTag('a', X2Html::mergeHtmlOptions(array('href' => $this->getHref()), $this->linkHtmlOptions));
$html .= "<i class='icon " . lcfirst($this->getId()) . "'></i>";
$html .= CHtml::encode($this->getTitle());
$html .= '</a>';
$html .= '</li>';
return $html;
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:13,代码来源:PanelItem.php
示例14: renderInput
public function renderInput($attr)
{
switch ($attr) {
case 'email':
echo '<p class="fieldhelp-thin-small">' . Yii::t('app', '([email protected])') . '</p>';
echo CHtml::activeTextField($this, $attr, $this->htmlOptions($attr));
break;
case 'password':
echo X2Html::x2ActivePasswordField($this, $attr, $this->htmlOptions($attr), true);
break;
default:
parent::renderInput($attr);
}
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:14,代码来源:GMailAccount.php
示例15: renderMoreButton
public function renderMoreButton()
{
$pager = Yii::createComponent(array('class' => Yii::app()->controller->pathAliasBase . 'components.MobileRecordIndexPager', 'pages' => $this->dataProvider->getPagination()));
$currentPage = $pager->getCurrentPage(false);
$pageCount = $pager->getPageCount();
//$href = $pager->createPageUrl ($currentPage + 1),
//$href = UrlUtil::mergeParams (Yii::app()->request->url, array (
//));
if ($currentPage + 1 < $pageCount) {
$html = CHtml::openTag('a', array('href' => $pager->createPageUrl($currentPage + 1), 'class' => 'more-button record-list-item'));
$html .= X2Html::fa('ellipsis-h');
$html .= '<span>' . CHtml::encode(Yii::t('app', 'More')) . '</span>';
$html .= "</a>";
echo $html;
}
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:16,代码来源:RecordIndexListView.php
示例16: renderLayout
public function renderLayout()
{
$html = '';
//$html .= $this->renderName ();
foreach ($this->layoutData as $fieldName) {
$field = $this->model->getField($fieldName);
if (!$this->canView($field)) {
continue;
}
if (!$field) {
continue;
}
$html .= $this->renderField($field, $this->renderLabel($field->attributeLabel) . $this->renderValue($fieldName, array()), array('data-x2-field-type' => X2Html::sanitizeAttribute($field->type)));
}
return $html;
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:16,代码来源:MobileViewLayoutRenderer.php
示例17: renderButtons
public function renderButtons()
{
$stickyButton = '';
if (Yii::app()->user->checkAccess('TopicsPinUnpinTopic')) {
$stickyButton = X2Html::link($this->model->sticky ? Yii::t('topics', 'Unpin Topic') : Yii::t('topics', 'Pin Topic'), '#', array('id' => 'sticky-topic', 'data-id' => $this->model->id, 'class' => 'x2-button', 'style' => 'vertical-align:top;'));
Yii::app()->clientScript->registerScript('pin-topic', '
$(document).on("click","#sticky-topic",function(){
$.ajax({
url:"' . Yii::app()->controller->createUrl('/topics/topics/pinUnpinTopic') . '",
data:{id:$(this).attr("data-id")},
beforeSend:function(){
x2.forms.inputLoading($("#sticky-topic"));
},
success:function(data){
$("#sticky-topic").html(data);
x2.forms.inputLoadingStop($("#sticky-topic"));
}
});
return false;
});
', CClientScript::POS_READY);
}
echo "<span class='list-view-title-bar-buttons'>\n {$stickyButton}\n <div id='show-topics-relationships-button' class='x2-button'>Relationships</div>\n <div id='show-topics-tags-button' class='x2-button'>Tags</div>\n </span>";
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:24,代码来源:TopicsListView.php
示例18: getSettingsMenuContentDialogs
protected function getSettingsMenuContentDialogs()
{
return '<div id="grid-settings-dialog-' . $this->widgetKey . '"
style="display: none;">' . '<div>' . Yii::t('profile', 'Use persistent filter and sort settings?') . '</div>' . CHtml::checkbox('dbPersistentGridSettings', self::getJSONProperty($this->profile, 'dbPersistentGridSettings', $this->widgetType, $this->widgetUID), array('id' => 'dbPersistentGridSettings-' . $this->widgetKey)) . X2Html::hint(Yii::t('profile', 'Leaving this box checked will prevent your grid filter and ' . 'sort settings from being reset when you log out of the app.'), false, null, true, true) . '</div>' . parent::getSettingsMenuContentDialogs();
}
开发者ID:dsyman2,项目名称:X2CRM,代码行数:5,代码来源:ProfileGridViewWidget.php
示例19: renderModelInput
//.........这里部分代码省略.........
var label = "<a style=\\"line-height: 1;\\">" + item.label;
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;
开发者ID:tymiles003,项目名称:X2CRM,代码行数:67,代码来源:X2Model.php
示例20: renderBoolean
/**
* renders boolean fields in view layouts as icons, instead of as unchecked checkboxes.
*/
protected function renderBoolean($field, $makeLinks, $textOnly, $encode)
{
$fieldName = $field->fieldName;
$bool = $this->owner->{$fieldName};
if ($textOnly) {
$text = $bool ? Yii::t('app', 'Yes') : Yii::t('app', 'No');
return $this->render($text, $encode);
}
$html = $bool ? X2Html::fa('check', array('class' => 'field-checked')) : X2Html::fa('times', array('class' => 'field-unchecked'));
return $html;
}
开发者ID:tymiles003,项目名称:X2CRM,代码行数:14,代码来源:FieldFormatter.php
注:本文中的X2Html类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论