本文整理汇总了PHP中Control::wrapXML方法的典型用法代码示例。如果您正苦于以下问题:PHP Control::wrapXML方法的具体用法?PHP Control::wrapXML怎么用?PHP Control::wrapXML使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Control
的用法示例。
在下文中一共展示了Control::wrapXML方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getXML
public function getXML($data)
{
$content = self::getChildrenXML($data);
if (!empty($content)) {
return parent::wrapXML(array('type' => 'group', 'tab' => (bool) $this->tab, 'mode' => $this->mode), $content);
}
}
示例2: getXML
public function getXML($data)
{
if (null === ($value = $data->{$this->value})) {
$value = $this->default;
}
return parent::wrapXML(array('type' => 'hidden'), html::cdata($value));
}
示例3: getXML
public function getXML($data)
{
if (empty($data->{$this->value})) {
return;
}
return parent::wrapXML(array('value' => $this->renderContent($data->{$this->value})));
}
示例4: getXML
public function getXML($data)
{
if (!$this->isActive($data)) {
return;
}
// Сбрасываем капчу, чтобы если отключена загрузка картинок,
// пользователь получил ошибку.
mcms::session('captcha:' . $this->value, null);
return parent::wrapXML(array());
}
示例5: getXML
public function getXML($data)
{
if (is_array($content = $data->{$this->value})) {
$content = join("\n", $content);
}
if (empty($content) and isset($this->default)) {
$content = $this->default;
}
return parent::wrapXML(array('type' => 'textarea', 'rows' => $this->rows, 'cols' => $this->cols), html::cdata($content));
}
示例6: getXML
public function getXML($data)
{
if (empty($data[$this->value])) {
return;
}
$items = '';
foreach ($data->{$this->value} as $rid => $info) {
$items .= html::em('item', array('uid' => $info['uid'], 'username' => $info['username'], 'rid' => $rid, 'created' => $info['created']));
}
return empty($items) ? null : parent::wrapXML(array(), $items);
}
示例7: getXML
public function getXML($data)
{
if (isset($this->hidden)) {
return $this->getHidden($data);
}
if (null === ($value = $data->{$this->value})) {
$value = $this->default;
}
if ($value == $this->default) {
$value = null;
}
return parent::wrapXML(array('type' => 'text', 'mode' => 'number'), $value);
}
示例8: getXML
/**
* Возвращает XML для отображения контрола.
*/
public function getXML($data)
{
// Существующий объект, ничего не делаем.
if (!empty($data->id)) {
return;
}
$user = Context::last()->user;
// Пользователь залогинен, делать нечего.
if (!$this->required and $user->id) {
return parent::wrapXML(array('type' => 'checkbox', 'title' => t('Опубликовать анонимно (а не как %name)', array('%name' => $user->getNode()->getName()))));
} elseif (!$user->id) {
return parent::wrapXML(array('type' => 'text', 'title' => t('Имя или ник')));
}
}
示例9: getXML
public function getXML($data)
{
if ($this->hidden) {
return $this->getHidden($data);
}
$map = array('select' => 'drop');
if (isset($map[$mode = $this->mode])) {
$mode = $map[$mode];
}
if ('enter' != $mode) {
return parent::wrapXML(array('type' => 'select', 'mode' => $mode, 'value' => $this->getCurrentValue($data)), $this->getSelect($data));
}
return parent::wrapXML(array('type' => 'text'), html::cdata($this->getCurrentValue($data)));
}
示例10: getXML
public function getXML($data)
{
$options = '';
if (!$this->required) {
$options .= html::em('option', array('value' => ''), html::cdata($this->default_label));
}
$enabled = $this->getEnabled($data);
if (is_array($enabled) and count($enabled) == 1) {
return html::em('input', array('type' => 'hidden', 'name' => $this->value, 'value' => array_shift($enabled)));
}
$selected = $this->getSelected($data);
$list = $this->prepend + $this->getData($data);
foreach ($list as $k => $v) {
$options .= html::em('option', array('value' => $k, 'selected' => in_array($k, $selected), 'disabled' => !(null === $enabled or in_array($k, $enabled))), html::cdata($v));
}
return parent::wrapXML(array('type' => 'select', 'mode' => $this->getMode()), $options);
}
示例11: getXML
public function getXML($data)
{
$options = $this->getOptions($data);
if (empty($options)) {
return null;
}
$selected = $this->getSelected($data);
$enabled = $this->getEnabled($data);
$options = $this->filterOptions($options, $enabled, $selected);
// Если ни одна опция не разрешена — не выводим контрол.
if ($enabled !== null and empty($enabled)) {
return null;
}
$output = '';
foreach ($options as $k => $v) {
$disabled = (null !== $enabled and !in_array($k, $enabled)) ? true : false;
$output .= html::em('option', array('value' => $k, 'selected' => in_array($k, $selected), 'disabled' => !empty($disabled)), html::cdata($v));
}
return parent::wrapXML(array('type' => 'select', 'mode' => 'set'), $output);
}
示例12: getXML
public function getXML($data)
{
$selected = $data->{$this->value};
if (null === $selected) {
if (null !== $this->default and array_key_exists($this->default, $this->options)) {
$selected = $this->default;
} elseif ($this->required) {
$tmp = array_keys($this->options);
$selected = $tmp[0];
}
}
if (count($options = $this->getData())) {
$output = '';
foreach ($options as $k => $v) {
$output .= html::em('option', array('selected' => $selected == $k, 'value' => $k), html::cdata($v));
}
}
if (!empty($output)) {
return parent::wrapXML(array('type' => 'select', 'mode' => 'radio'), $output);
}
}
示例13: getXML
public function getXML($data)
{
return parent::wrapXML(array('type' => 'file'));
}
示例14: getXML
public function getXML($data)
{
return parent::wrapXML(array('type' => 'text', 'maxlength' => $this->getMaxLength()), html::cdata($this->getValue($data)));
}
示例15: getXML
public function getXML($data)
{
return parent::wrapXML(array('type' => 'text', 'mode' => 'datetime'), html::cdata($data->{$this->value}));
}