本文整理汇总了PHP中X2Html类的典型用法代码示例。如果您正苦于以下问题:PHP X2Html类的具体用法?PHP X2Html怎么用?PHP X2Html使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了X2Html类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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;
}
示例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));
}
}
示例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));
}
示例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)));
}
}
示例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');
}
示例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;
}
示例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();
}
示例8: renderInput
public function renderInput($attr)
{
switch ($attr) {
case 'password':
echo X2Html::x2ActivePasswordField($this, $attr, $this->htmlOptions($attr), true);
break;
default:
parent::renderInput($attr);
}
}
示例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);
}
}
示例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);
}
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例14: renderInput
public function renderInput($attr)
{
switch ($attr) {
case 'email':
echo '<p class="fieldhelp-thin-small">' . Yii::t('app', '(example@gmail.com)') . '</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);
}
}
示例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;
}
}