• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP N2XmlHelper类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中N2XmlHelper的典型用法代码示例。如果您正苦于以下问题:PHP N2XmlHelper类的具体用法?PHP N2XmlHelper怎么用?PHP N2XmlHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了N2XmlHelper类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。

示例1: fetchElement

 function fetchElement()
 {
     $min = N2XmlHelper::getAttribute($this->_xml, 'min');
     if ($min == '') {
         $min = '-Number.MAX_VALUE';
     }
     $max = N2XmlHelper::getAttribute($this->_xml, 'max');
     if ($max == '') {
         $max = 'Number.MAX_VALUE';
     }
     N2JS::addInline('new NextendElementNumber("' . $this->_id . '", ' . $min . ', ' . $max . ');');
     $html = N2Html::openTag('div', array('class' => 'n2-form-element-text ' . $this->getClass() . ($this->_xml->unit ? 'n2-text-has-unit ' : '') . 'n2-border-radius', 'style' => $this->fieldType == 'hidden' ? 'display: none;' : ''));
     $subLabel = N2XmlHelper::getAttribute($this->_xml, 'sublabel');
     if ($subLabel) {
         $html .= N2Html::tag('div', array('class' => 'n2-text-sub-label n2-h5 n2-uc'), n2_($subLabel));
     }
     $html .= $this->pre();
     $html .= N2Html::tag('input', array('type' => $this->fieldType, 'id' => $this->_id, 'name' => $this->_inputname, 'value' => $this->_form->get($this->_name, $this->_default), 'class' => 'n2-h5', 'style' => $this->getStyle(), 'autocomplete' => 'off'), false);
     $html .= $this->post();
     if ($this->_xml->unit) {
         $html .= N2Html::tag('div', array('class' => 'n2-text-unit n2-h5 n2-uc'), n2_((string) $this->_xml->unit));
     }
     $html .= "</div>";
     return $html;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:25,代码来源:number.php


示例2: addSimple

 protected function addSimple()
 {
     $simple = $this->_xml->addChild('param');
     $simple->addAttribute('type', 'group');
     $area = $simple->addChild('param');
     $area->addAttribute('type', 'sliderwidgetarea');
     $area->addAttribute('name', $this->_name . '-area');
     $area->addAttribute('default', N2XmlHelper::getAttribute($this->_xml, 'area'));
     $priority = $simple->addChild('param');
     $priority->addAttribute('type', 'list');
     $priority->addAttribute('name', $this->_name . '-stack');
     $priority->addAttribute('label', n2_('Stack'));
     $priority->addAttribute('default', N2XmlHelper::getAttribute($this->_xml, 'stack', '1'));
     $priority->addAttribute('class', 'n2-expert');
     for ($i = 1; $i < 5; $i++) {
         $pri = $priority->addChild('option', $i);
         $pri->addAttribute('value', $i);
     }
     $offset = $simple->addChild('param');
     $offset->addAttribute('type', 'text');
     $offset->addAttribute('name', $this->_name . '-offset');
     $offset->addAttribute('label', 'Offset');
     $offset->addAttribute('style', 'width:30px;');
     $offset->addAttribute('default', N2XmlHelper::getAttribute($this->_xml, 'offset', '0'));
     $offset->addChild('unit', 'px')->addAttribute('value', 'px');
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:26,代码来源:widgetposition.php


示例3: fetchElement

 function fetchElement()
 {
     N2JS::addInline('new NextendElementRichText("' . $this->_id . '");');
     $tools = array(N2Html::tag('div', array('class' => 'n2-textarea-rich-bold'), N2Html::tag('I', array('class' => 'n2-i n2-it n2-i-bold'))), N2Html::tag('div', array('class' => 'n2-textarea-rich-italic'), N2Html::tag('I', array('class' => 'n2-i n2-it n2-i-italic'))), N2Html::tag('div', array('class' => 'n2-textarea-rich-link'), N2Html::tag('I', array('class' => 'n2-i n2-it n2-i-link'))));
     $rich = N2Html::tag('div', array('class' => 'n2-textarea-rich'), implode('', $tools));
     return N2Html::tag('div', array('class' => 'n2-form-element-textarea n2-form-element-rich-textarea n2-border-radius', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')), $rich . N2Html::tag('textarea', array('id' => $this->_id, 'name' => $this->_inputname, 'class' => 'n2 - h5', 'autocomplete' => 'off', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style2')), $this->_form->get($this->_name, $this->_default)));
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:7,代码来源:richtextarea.php


示例4: getGroup

 private function getGroup()
 {
     if (empty($this->group)) {
         $this->group = N2XmlHelper::getAttribute($this->_xml, 'method');
     }
     return $this->group;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:7,代码来源:widgetpluginmatrix.php


示例5: render

    function render($control_name)
    {
        $this->initTabs();
        $id = 'n2-form-matrix-' . $this->_name;
        $active = intval(N2XmlHelper::getAttribute($this->_xml, 'active'));
        $active = $active > 0 ? $active - 1 : 0;
        $underlined = N2XmlHelper::getAttribute($this->_xml, 'underlined');
        $classes = N2XmlHelper::getAttribute($this->_xml, 'classes');
        ?>

        <div id="<?php 
        echo $id;
        ?>
" class="n2-form-tab n2-form-matrix">
            <div
                class="n2-h2 n2-content-box-title-bg n2-form-matrix-views <?php 
        echo $classes;
        ?>
">
                <?php 
        $i = 0;
        $class = ($underlined ? 'n2-underline' : '') . ' n2-h4 n2-uc n2-has-underline n2-form-matrix-menu';
        foreach ($this->_tabs as $tabName => $tab) {
            echo N2Html::tag("div", array("class" => $class . ($i == $active ? ' n2-active' : '') . ' n2-fm-' . $tabName), N2Html::tag("span", array("class" => "n2-underline"), n2_(N2XmlHelper::getAttribute($tab->_xml, 'label'))));
            $i++;
        }
        ?>
            </div>

            <div class="n2-tabs">
                <?php 
        $i = 0;
        foreach ($this->_tabs as $tabName => $tab) {
            echo N2Html::openTag('div', array('class' => 'n2-form-matrix-pane' . ($i == $active ? ' n2-active' : '') . ' n2-fm-' . $tabName));
            $tab->render($control_name);
            echo N2Html::closeTag('div');
            $i++;
        }
        ?>
            </div>
        </div>

        <?php 
        N2JS::addInline('
            (function(){
                var matrix = $("#' . $id . '"),
                    views = matrix.find("> .n2-form-matrix-views > div"),
                    panes = matrix.find("> .n2-tabs > div");
                views.on("click", function(){
                    views.removeClass("n2-active");
                    panes.removeClass("n2-active");
                    var i = views.index(this);
                    views.eq(i).addClass("n2-active");
                    panes.eq(i).addClass("n2-active");
                });
            })()
        ');
        ?>
    <?php 
    }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:60,代码来源:tabbed.php


示例6: decorateTitle

 function decorateTitle()
 {
     $id = N2XmlHelper::getAttribute($this->_xml, 'id');
     echo "<div id='" . $id . "' class='nextend-tab " . N2XmlHelper::getAttribute($this->_xml, 'class') . "'>";
     if (isset($GLOBALS[$id])) {
         echo $GLOBALS[$id];
     }
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:8,代码来源:placeholder.php


示例7: generateOptions

 function generateOptions(&$xml)
 {
     $html = '';
     foreach ($xml->option as $option) {
         $v = N2XmlHelper::getAttribute($option, 'value');
         $html .= '<option value="' . $v . '" ' . $this->isSelected($v) . '>' . ($this->_translateable ? n2_((string) $option) : (string) $option) . '</option>';
     }
     return $html;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:9,代码来源:list.php


示例8: fetchElement

 function fetchElement()
 {
     $html = "<div class='n2-form-element-onoff " . $this->isOn() . "' style='" . N2XmlHelper::getAttribute($this->_xml, 'style') . "'>";
     $html .= N2Html::tag('div', array('class' => 'n2-onoff-slider'), N2Html::tag('div', array('class' => 'n2-onoff-no'), '<i class="n2-i n2-i-close"></i>') . N2Html::tag('div', array('class' => 'n2-onoff-round')) . N2Html::tag('div', array('class' => 'n2-onoff-yes'), '<i class="n2-i n2-i-tick"></i>'));
     $html .= parent::fetchElement();
     $html .= "</div>";
     N2JS::addInline('new NextendElementOnoff("' . $this->_id . '");');
     return $html;
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:9,代码来源:onoff.php


示例9: getOptions

 function getOptions()
 {
     if ($this->_list == null) {
         $this->_list = array();
         N2Plugin::callPlugin(N2XmlHelper::getAttribute($this->_xml, 'group'), N2XmlHelper::getAttribute($this->_xml, 'method'), array(&$this->_list));
     }
     uasort($this->_list, array($this, 'sort'));
     return $this->_list;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:9,代码来源:pluginmatrix.php


示例10: fetchElement

 function fetchElement()
 {
     if (N2XmlHelper::getAttribute($this->_xml, 'alpha') == 1) {
         $this->alpha = 1;
     }
     $html = parent::fetchElement();
     N2JS::addInline('new NextendElementColor("' . $this->_id . '", ' . $this->alpha . ');');
     return $html;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:9,代码来源:color.php


示例11: setFolder

 function setFolder()
 {
     $folder = N2XmlHelper::getAttribute($this->_xml, 'folder');
     if (!empty($folder) && $folder[0] != '$') {
         $folder = dirname($this->_form->_xmlfile) . '/' . $folder . '/';
     } else {
         $folder = N2ImageHelper::fixed($folder, true);
     }
     $this->_folder = N2Filesystem::translate($folder);
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:10,代码来源:imagelistfromfolder.php


示例12: fetchElement

 function fetchElement()
 {
     N2JS::addInline('new NextendElementFont("' . $this->_id . '", {
         previewmode: "' . N2XmlHelper::getAttribute($this->_xml, 'previewmode') . '",
         style: "' . N2XmlHelper::getAttribute($this->_xml, 'style') . '",
         style2: "' . N2XmlHelper::getAttribute($this->_xml, 'style2') . '",
         preview: ' . json_encode((string) $this->_xml) . ',
         set: "' . N2XmlHelper::getAttribute($this->_xml, 'set') . '"
     });');
     return N2Html::tag('div', array('class' => 'n2-form-element-option-chooser n2-border-radius'), parent::fetchElement() . N2Html::tag('input', array('type' => 'text', 'class' => 'n2-h5', 'style' => 'width: 130px;' . N2XmlHelper::getAttribute($this->_xml, 'css'), 'disabled' => 'disabled'), false) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-clear'), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-empty n2-i-grey-opacity'), '')) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-button n2-h5 n2-uc'), n2_('Font')));
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:11,代码来源:font.php


示例13: render

 function render($control_name = 'params', $tooltip = true)
 {
     $this->control_name = $control_name;
     $this->_default = N2XmlHelper::getAttribute($this->_xml, 'default');
     $this->_id = $this->generateId($control_name . $this->_name);
     $this->_inputname = N2XmlHelper::getAttribute($this->_xml, 'hidename') ? '' : $control_name . '[' . $this->_name . ']';
     $this->_label = N2XmlHelper::getAttribute($this->_xml, 'label');
     if ($this->_label == '') {
         $this->_label = $this->_name;
     }
     return array($tooltip ? $this->fetchTooltip() : '', $this->fetchElement());
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:12,代码来源:element.php


示例14: generateOptions

 function generateOptions(&$xml)
 {
     $this->values = array();
     $html = '';
     foreach ($xml->option as $option) {
         $value = N2XmlHelper::getAttribute($option, 'value');
         $selected = $this->isSelected($value);
         $this->values[] = $value;
         $html .= N2Html::tag("div", array("class" => "n2-radio-option n2-imagelist-option" . ($selected ? ' n2-active' : ''), "style" => "background-image:url(" . N2ImageHelper::fixed(N2XmlHelper::getAttribute($option, 'image')) . ");"), N2Html::tag('span', array(), (string) $option));
     }
     return $html;
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:12,代码来源:imagelistlabel.php


示例15: generateOptions

 function generateOptions(&$xml)
 {
     $length = count($xml->option) - 1;
     $html = '';
     $i = 0;
     foreach ($xml->option as $option) {
         $value = N2XmlHelper::getAttribute($option, 'value');
         $this->values[] = $value;
         $html .= N2Html::tag('div', array('class' => 'n2-radio-option n2-h4' . ($this->isSelected($value) ? ' n2-active' : '') . ($i == 0 ? ' n2-first' : '') . ($i == $length ? ' n2-last' : '')), n2_((string) $option));
         $i++;
     }
     return $html;
 }
开发者ID:MBerguer,项目名称:wp-demo,代码行数:13,代码来源:radiotab.php


示例16: generateOptions

 function generateOptions(&$xml)
 {
     $length = count($xml->option) - 1;
     $html = '';
     $i = 0;
     foreach ($xml->option as $option) {
         $v = N2XmlHelper::getAttribute($option, 'value');
         $this->values[] = $v;
         $html .= N2Html::tag('div', array('class' => 'n2-radio-option n2-h4' . ($this->isSelected($v) ? ' n2-active' : '') . ($i == 0 ? ' n2-first' : '') . ($i == $length ? ' n2-last' : '')), N2Html::tag('div', array('class' => 'n2-radio-option-marker'), '<i class="n2-i n2-it n2-i-tick"></i>') . '<span>' . n2_((string) $option) . '</span>');
         $i++;
     }
     return $html;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:13,代码来源:radio.php


示例17: fetchElement

 function fetchElement()
 {
     $preview = preg_replace_callback('/url\\(\'(.*?)\'\\)/', 'N2ElementStyle::fixPreviewImages', (string) $this->_xml);
     N2JS::addInline('new NextendElementStyle("' . $this->_id . '", {
         previewmode: "' . N2XmlHelper::getAttribute($this->_xml, 'previewmode') . '",
         font: "' . N2XmlHelper::getAttribute($this->_xml, 'font') . '",
         font2: "' . N2XmlHelper::getAttribute($this->_xml, 'font2') . '",
         style2: "' . N2XmlHelper::getAttribute($this->_xml, 'style2') . '",
         preview: ' . json_encode($preview) . ',
         set: "' . N2XmlHelper::getAttribute($this->_xml, 'set') . '"
     });');
     return N2Html::tag('div', array('class' => 'n2-form-element-option-chooser n2-border-radius'), parent::fetchElement() . N2Html::tag('input', array('type' => 'text', 'class' => 'n2-h5', 'style' => 'width: 130px;' . N2XmlHelper::getAttribute($this->_xml, 'css'), 'disabled' => 'disabled'), false) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-clear'), N2Html::tag('i', array('class' => 'n2-i n2-it n2-i-empty n2-i-grey-opacity'), '')) . N2Html::tag('a', array('href' => '#', 'class' => 'n2-form-element-button n2-h5 n2-uc'), n2_('Style')));
 }
开发者ID:rfulwell,项目名称:transitionalresources.org,代码行数:13,代码来源:style.php


示例18: generateOptions

 function generateOptions(&$xml)
 {
     $html = '';
     foreach ($xml->option as $option) {
         $v = N2XmlHelper::getAttribute($option, 'value');
         $this->values[] = $v;
         $attributes = array('class' => 'nextend-checkbox-option');
         if ($this->isSelected($v)) {
             $attributes['selected'] = 'selected';
         }
         $html .= N2Html::tag('div', $attributes, (string) $option);
     }
     return $html;
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:14,代码来源:checkbox.php


示例19: loadList

 function loadList()
 {
     if ($this->_list == null) {
         $this->_group = array();
         $this->_list = array();
         N2Plugin::callPlugin(N2XmlHelper::getAttribute($this->_xml, 'plugingroup'), N2XmlHelper::getAttribute($this->_xml, 'method'), array(&$this->_group, &$this->_list));
         $v = explode('_', $this->getValue());
         if (!isset($this->_list[$v[0]][$this->getValue()])) {
             $keys = array_keys($this->_list);
             $ks = array_keys($this->_list[$keys[0]]);
             $this->setValue($this->_list[$keys[0]][$ks[0]]);
         }
     }
 }
开发者ID:vicpril,项目名称:rep_bidqa,代码行数:14,代码来源:plugingroup.php


示例20: fetchElement

 function fetchElement()
 {
     $this->_translateable = N2XmlHelper::getAttribute($this->_xml, 'translateable');
     $this->_translateable = $this->_translateable === '0' ? false : true;
     $html = '';
     foreach ($this->_xml->param as $element) {
         $class = N2Form::importElement(N2XmlHelper::getAttribute($element, 'type'));
         $el = new $class($this->_form, $this, $element);
         list($label, $field) = $el->render($this->control_name, $this->_translateable);
         $html .= N2Html::tag('div', array('class' => 'n2-mixed-group ' . N2XmlHelper::getAttribute($element, 'class')), N2Html::tag('div', array('class' => 'n2-mixed-label'), $label) . N2Html::tag('div', array('class' => 'n2-mixed-element'), $field));
         if (N2XmlHelper::getAttribute($element, 'post') == 'break') {
             $html .= '<br class="' . N2XmlHelper::getAttribute($element, 'class') . '" />';
         }
     }
     return N2Html::tag('div', array('class' => 'n2-form-element-mixed', 'style' => N2XmlHelper::getAttribute($this->_xml, 'style')), $html);
 }
开发者ID:RenatoToasa,项目名称:Pagina-Web,代码行数:16,代码来源:group.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP NCoreMacros类代码示例发布时间:2022-05-23
下一篇:
PHP N2Request类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap