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


PHP utils::jsEncode方法代码示例

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


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

示例1: toHtml

    public function toHtml()
    {
        if ($this->cfg->mode == 'view') {
            return $this->getValue();
        }
        $options = $this->tinyMce;
        if (is_array($this->cfg->tinyBrowser) && $this->cfg->getInArray('tinyBrowser', 'active')) {
            $tinyBrowser = $this->cfg->tinyBrowser;
            $options['file_browser_callback'] = 'function(field_name, url, type, win) {
				tinyMCE.activeEditor.windowManager.open({
					file : "' . $tinyBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type=" + type' . ($tinyBrowser['subdir'] ? '+"&subdir=' . $tinyBrowser['subdir'] . '"' : '') . ',
					title : "' . $tinyBrowser['title'] . '",
					width : ' . $tinyBrowser['width'] . ',
					height : ' . $tinyBrowser['height'] . ',
					resizable : "yes",
					scrollbars : "yes",
					inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
					close_previous : "no"
				}, {
					window : win,
					input : field_name
				});
				return false;
			}';
        } else {
            if (is_array($this->cfg->nyroBrowser) && $this->cfg->getInArray('nyroBrowser', 'active')) {
                $nyroBrowser = $this->cfg->nyroBrowser;
                $options['file_browser_callback'] = 'function(field_name, url, type, win) {
				tinyMCE.activeEditor.windowManager.open({
					file : "' . $nyroBrowser['url'] . '?' . session::getInstance()->getSessIdForce() . '=' . urlencode(session_id()) . '&type="+type+"&config=' . $nyroBrowser['config'] . '&",
					title : "' . $nyroBrowser['title'] . '",
					width : ' . $nyroBrowser['width'] . ',
					height : ' . $nyroBrowser['height'] . ',
					resizable : "yes",
					scrollbars : "yes",
					inline : "yes",  // This parameter only has an effect if you use the inlinepopups plugin!
					close_previous : "no"
				}, {
					window : win,
					input : field_name
				});
				return false;
			}';
            }
        }
        if (array_key_exists('content_css', $options) && $options['content_css']) {
            $contentCss = $options['content_css'];
            $options['setup'] = 'function(ed) {ed.onInit.add(function(ed) {setTimeout(function() {ed.dom.add(ed.dom.select("head"), "link", {rel : "stylesheet", href : "' . $contentCss . '"});}, 5);});}';
        }
        unset($options['content_css']);
        $resp = response::getInstance()->getProxy();
        $resp->addJs('jquery.tinymce');
        $resp->blockjQuery('$("#' . $this->id . '").tinymce(' . utils::jsEncode($options) . ');');
        return utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name, 'id' => $this->id)), utils::htmlOut($this->getValue()));
    }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:55,代码来源:richtext.class.php

示例2: toHtml

 public function toHtml()
 {
     if ($this->cfg->mode == 'view') {
         return $this->date->format('date', 'short2');
     }
     if ($this->cfg->useJs) {
         $resp = response::getInstance();
         $resp->addJs('jqueryui');
         $resp->blockJquery('$("#' . $this->id . '").datepicker(' . utils::jsEncode($this->jsPrm) . ');');
     }
     return utils::htmlTag($this->htmlTagName, array_merge($this->html, array('name' => $this->name, 'id' => $this->id, 'value' => $this->date->format('date', 'short2'))));
 }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:12,代码来源:date.class.php

示例3: toHtml

    public function toHtml()
    {
        if ($this->cfg->useJs) {
            $this->cfg->setInArray('html', 'class', $this->cfg->getInArray('html', 'class') . ' date');
            $resp = response::getInstance();
            $resp->addJs('jqueryui');
            if (($lang = request::get('lang')) != 'en') {
                $resp->addJs('i18n_ui.datepicker-' . $lang);
            }
            $jsPrmMin = $this->cfg->jsPrm;
            $jsPrmMax = $this->cfg->jsPrm;
            $minId = $this->makeId($this->name . '[0]');
            $maxId = $this->makeId($this->name . '[1]');
            $minDate = $this->dates['min']->getJs(null);
            $maxDate = $this->dates['max']->getJs(null);
            $jsPrmMin['onSelect'] = 'function(dateText) {$("#' . $maxId . '").datepicker("option", "minDate", $("#' . $minId . '").datepicker("getDate"));}';
            if ($maxDate) {
                $jsPrmMin['maxDate'] = $maxDate;
            }
            $jsPrmMax['onSelect'] = 'function(dateText) {$("#' . $minId . '").datepicker("option", "maxDate", $("#' . $maxId . '").datepicker("getDate"));}';
            if ($minDate) {
                $jsPrmMax['minDate'] = $minDate;
            }
            $resp->blockJquery('
				$("#' . $minId . '").datepicker(' . utils::jsEncode($jsPrmMin) . ');
				$("#' . $maxId . '").datepicker(' . utils::jsEncode($jsPrmMax) . ');
			');
        }
        return parent::toHtml();
    }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:30,代码来源:date.class.php

示例4: plupload

 /**
  * Make the field plupload for asynchronous upload.
  *
  * @param array $opts Plupload options
  * @param boolean $hideSubmit Indicate if the submit button should be hide by JavaScript
  */
 public function plupload(array $opts = array(), $hideSubmit = true)
 {
     $resp = response::getInstance();
     $resp->addJs('jquery');
     $resp->addJs('plupload');
     $resp->addJs('nyroPlupload');
     $resp->addCss('plupload');
     $pluploadOpts = $this->cfg->plupload;
     if (count($opts)) {
         factory::mergeCfg($pluploadOpts, $opts);
     }
     $pluploadOpts['file_data_name'] = $this->name;
     $resp->blockjQuery('$("#' . $this->id . '").nyroPlupload(' . utils::jsEncode($pluploadOpts) . ');');
     if ($hideSubmit) {
         $resp->blockjQuery('$("#' . $this->id . '").closest("form").find("fieldset.submit").hide();');
     }
 }
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:23,代码来源:file.class.php

示例5: unset

<?php
unset($this->vars['response']);
echo utils::jsEncode($this->vars);
?>
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:4,代码来源:default.json.php

示例6:

<?php echo utils::jsEncode(array('content'=>$content)); ?>
开发者ID:nyroDev,项目名称:nyroFwk,代码行数:1,代码来源:layout.json.php


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