当前位置: 首页>>代码示例>>PHP>>正文


PHP Control::wrapXML方法代码示例

本文整理汇总了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);
     }
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:7,代码来源:control.fieldset.php

示例2: getXML

 public function getXML($data)
 {
     if (null === ($value = $data->{$this->value})) {
         $value = $this->default;
     }
     return parent::wrapXML(array('type' => 'hidden'), html::cdata($value));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:7,代码来源:control.hidden.php

示例3: getXML

 public function getXML($data)
 {
     if (empty($data->{$this->value})) {
         return;
     }
     return parent::wrapXML(array('value' => $this->renderContent($data->{$this->value})));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:7,代码来源:control.orderdetails.php

示例4: getXML

 public function getXML($data)
 {
     if (!$this->isActive($data)) {
         return;
     }
     // Сбрасываем капчу, чтобы если отключена загрузка картинок,
     // пользователь получил ошибку.
     mcms::session('captcha:' . $this->value, null);
     return parent::wrapXML(array());
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:10,代码来源:control.captcha.php

示例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));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:10,代码来源:control.textarea.php

示例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);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:11,代码来源:control.history.php

示例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);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:13,代码来源:control.number.php

示例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('Имя или ник')));
     }
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:17,代码来源:control.user.php

示例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)));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:14,代码来源:control.nodelink.php

示例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);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:17,代码来源:control.enum.php

示例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);
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:20,代码来源:control.set.php

示例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);
     }
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:21,代码来源:control.enumradio.php

示例13: getXML

 public function getXML($data)
 {
     return parent::wrapXML(array('type' => 'file'));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:4,代码来源:control.attachment.php

示例14: getXML

 public function getXML($data)
 {
     return parent::wrapXML(array('type' => 'text', 'maxlength' => $this->getMaxLength()), html::cdata($this->getValue($data)));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:4,代码来源:control.textline.php

示例15: getXML

 public function getXML($data)
 {
     return parent::wrapXML(array('type' => 'text', 'mode' => 'datetime'), html::cdata($data->{$this->value}));
 }
开发者ID:umonkey,项目名称:molinos-cms,代码行数:4,代码来源:control.datetime.php


注:本文中的Control::wrapXML方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。