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


PHP Context::loadFile方法代码示例

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


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

示例1: init

 /**
  * @brief Initialization
  **/
 function init()
 {
     $oTextyleModel =& getModel('textyle');
     if (preg_match("/TextyleTool/", $this->act) || $oTextyleModel->isAttachedMenu($this->act)) {
         if (__DEBUG__) {
             Context::loadFile(array('./modules/admin/tpl/css/admin.css', '', '', 10), true);
             Context::loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
             Context::loadFile(array("./modules/admin/tpl/css/admin.iefix.css", '', 'ie', 10), true);
             Context::loadFile('./modules/admin/tpl/js/admin.js', true);
             Context::loadFile(array('./modules/admin/tpl/css/admin.bootstrap.css', '', '', 1), true);
             Context::loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true);
             Context::loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true);
         } else {
             Context::loadFile(array('./modules/admin/tpl/css/admin.min.css', '', '', 10), true);
             Context::loadFile(array("./modules/admin/tpl/css/admin_{$lang_type}.css", '', '', 10), true);
             Context::loadFile(array("./modules/admin/tpl/css/admin.iefix.min.css", '', 'ie', 10), true);
             Context::loadFile('./modules/admin/tpl/js/admin.min.js', true);
             Context::loadFile(array('./modules/admin/tpl/css/admin.bootstrap.min.css', '', '', 1), true);
             Context::loadFile(array('./modules/admin/tpl/js/jquery.tmpl.js', '', '', 1), true);
             Context::loadFile(array('./modules/admin/tpl/js/jquery.jstree.js', '', '', 1), true);
         }
         $this->initTool($this);
     } else {
         $this->initService($this);
     }
 }
开发者ID:google-code-backups,项目名称:xe-textyle,代码行数:29,代码来源:textyle.view.php

示例2: dispEditorPopup

 /**
  * @brief Action to get a request to display compoenet pop-up
  */
 function dispEditorPopup()
 {
     // add a css file
     Context::loadFile($this->module_path . "tpl/css/editor.css", true);
     // List variables
     $editor_sequence = Context::get('editor_sequence');
     $component = Context::get('component');
     $site_module_info = Context::get('site_module_info');
     $site_srl = (int) $site_module_info->site_srl;
     // Get compoenet object
     $oEditorModel = getModel('editor');
     $oComponent =& $oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
     if (!$oComponent->toBool()) {
         Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
         $this->setTemplatePath($this->module_path . 'tpl');
         $this->setTemplateFile('component_not_founded');
     } else {
         // Get the result after executing a method to display popup url of the component
         $popup_content = $oComponent->getPopupContent();
         Context::set('popup_content', $popup_content);
         // Set layout to popup_layout
         $this->setLayoutFile('popup_layout');
         // Set a template
         $this->setTemplatePath($this->module_path . 'tpl');
         $this->setTemplateFile('popup');
     }
 }
开发者ID:umjinsun12,项目名称:dngshin,代码行数:30,代码来源:editor.view.php

示例3: __construct

 public function __construct()
 {
     if (!self::$scripts_added) {
         self::$scripts_added = true;
         Context::loadFile(array('./addons/recaptcha/recaptcha.js', 'body'));
         Context::addHtmlFooter('<script src="https://www.google.com/recaptcha/api.js?render=explicit&amp;onload=reCaptchaCallback" async defer></script>');
         $html = '<div id="recaptcha-config" data-sitekey="%s" data-theme="%s" data-size="%s"></div>';
         $html = sprintf($html, escape(self::$config->site_key), self::$config->theme ?: 'light', self::$config->size ?: 'normal');
         Context::addHtmlFooter($html);
     }
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:11,代码来源:recaptcha.class.php

示例4: triggerDisplayBefore

 function triggerDisplayBefore(&$content)
 {
     if (Context::getResponseMethod() != 'HTML') {
         return new Object();
     }
     $grant = Context::get('grant');
     $logged_info = Context::get('logged_info');
     if ((!$grant || $grant->manager != 1) && $logged_info->is_admin != 'Y') {
         return new Object();
     }
     preg_replace_callback('!<img([^\\>]*)widget=([^\\>]*?)\\>!is', array($this, '_setGrantByWidgetSequence'), $content);
     Context::loadFile('./modules/magiccontent/tpl/js/magiccontent_for_admin.js');
     Context::loadFile('./modules/magiccontent/tpl/css/magiccontent_for_admin.css');
     return new Object();
 }
开发者ID:ilbecms,项目名称:xe_module_magiccontent,代码行数:15,代码来源:magiccontent.controller.php

示例5: getKrzipCodeSearchHtml

 /**
  * @brief return zip code search template
  * offer krzip code search template for other modules
  **/
 function getKrzipCodeSearchHtml($column_name, $values)
 {
     $oModuleModel = getModel('module');
     $config = $oModuleModel->getModuleConfig('krzip');
     if ($config->krzip_server_hostname) {
         $this->hostname = $config->krzip_server_hostname;
     }
     if ($config->krzip_server_query) {
         $this->query = $config->krzip_server_query;
     }
     $krzip = new stdClass();
     $krzip->api_url = '//' . $this->hostname . $this->query;
     $krzip->column_name = $column_name;
     $krzip->values = $values;
     // load js file
     Context::loadFile(array($this->module_path . 'tpl/js/krzip_search.js'), true);
     Context::set('krzip', $krzip);
     $oTemplate =& TemplateHandler::getInstance();
     return $oTemplate->compile($this->module_path . 'tpl', 'krzip');
 }
开发者ID:JeonJonguk,项目名称:Pull-Request-Test,代码行数:24,代码来源:krzip.model.php

示例6:

<?php

/* Copyright (C) NAVER <http://www.navercorp.com> */
if (!defined('__XE__')) {
    exit;
}
/**
 * @file resize_image.addon.php
 * @author NAVER (developers@xpressengine.com)
 * @brief Add-on to resize images in the body
 */
if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !isCrawler()) {
    if (Mobile::isFromMobilePhone()) {
        Context::loadFile('./addons/resize_image/css/resize_image.mobile.css', true);
    } else {
        Context::loadJavascriptPlugin('ui');
        Context::loadFile(array('./addons/resize_image/js/resize_image.js', 'body', '', null), true);
    }
}
/* End of file resize_image.addon.php */
/* Location: ./addons/resize_image/resize_image.addon.php */
开发者ID:rhymix,项目名称:rhymix,代码行数:21,代码来源:resize_image.addon.php

示例7: dispEditorAdminIndex


//.........这里部分代码省略.........
         $editor_config->editor_skin = 'ckeditor';
     }
     if (!$editor_config->comment_editor_skin) {
         $editor_config->comment_editor_skin = 'ckeditor';
     }
     if (!$editor_config->sel_editor_colorset) {
         $editor_config->sel_editor_colorset = 'moono';
     }
     if (!$editor_config->sel_comment_editor_colorset) {
         $editor_config->sel_comment_editor_colorset = 'moono';
     }
     $component_list = $oEditorModel->getComponentList(false, $site_srl, true);
     $editor_skin_list = FileHandler::readDir(_XE_PATH_ . 'modules/editor/skins');
     $skin_info = $oModuleModel->loadSkinInfo($this->module_path, $editor_config->editor_skin);
     $contents = FileHandler::readDir(_XE_PATH_ . 'modules/editor/styles');
     $content_style_list = array();
     for ($i = 0, $c = count($contents); $i < $c; $i++) {
         $style = $contents[$i];
         $info = $oModuleModel->loadSkinInfo($this->module_path, $style, 'styles');
         $content_style_list[$style] = new stdClass();
         $content_style_list[$style]->title = $info->title;
     }
     // Get install info, update info, count
     $oAutoinstallModel = getModel('autoinstall');
     foreach ($component_list as $component_name => $xml_info) {
         $component_count++;
         $xml_info->path = './modules/editor/components/' . $xml_info->component_name;
         $xml_info->delete_url = $oAutoinstallModel->getRemoveUrlByPath($xml_info->path);
         $xml_info->package_srl = $oAutoinstallModel->getPackageSrlByPath($xml_info->path);
         if ($xml_info->package_srl) {
             $targetpackages[$xml_info->package_srl] = 0;
         }
     }
     if (is_array($targetpackages)) {
         $packages = $oAutoinstallModel->getInstalledPackages(array_keys($targetpackages));
     }
     foreach ($component_list as $component_name => $xml_info) {
         if ($packages[$xml_info->package_srl]) {
             $xml_info->need_update = $packages[$xml_info->package_srl]->need_update;
         }
     }
     $editor_config_default = array('editor_height' => 300, 'comment_editor_height' => 100);
     //editor preview
     $config = $oEditorModel->getEditorConfig();
     $option = new stdClass();
     $option->allow_fileupload = false;
     $option->content_style = $config->content_style;
     $option->content_font = $config->content_font;
     $option->content_font_size = $config->content_font_size;
     $option->content_line_height = $config->content_line_height;
     $option->content_paragraph_spacing = $config->content_paragraph_spacing;
     $option->content_word_break = $config->content_word_break;
     $option->additional_css = $config->additional_css ?: array();
     $option->enable_autosave = false;
     $option->enable_default_component = true;
     $option->enable_component = true;
     $option->disable_html = false;
     $option->height = $config->editor_height;
     $option->skin = $config->editor_skin;
     $option->content_key_name = 'dummy_content';
     $option->primary_key_name = 'dummy_key';
     $option->colorset = $config->sel_editor_colorset;
     $editor = $oEditorModel->getEditor(0, $option);
     Context::set('preview_editor', $editor);
     $option_com = new stdClass();
     $option_com->allow_fileupload = false;
     $option_com->content_style = $config->content_style;
     $option_com->content_font = $config->content_font;
     $option_com->content_font_size = $config->content_font_size;
     $option_com->content_line_height = $config->content_line_height;
     $option_com->content_paragraph_spacing = $config->content_paragraph_spacing;
     $option_com->content_word_break = $config->content_word_break;
     $option_com->additional_css = $config->additional_css ?: array();
     $option_com->enable_autosave = false;
     $option_com->enable_default_component = true;
     $option_com->enable_component = true;
     $option_com->disable_html = false;
     $option_com->height = $config->comment_editor_height;
     $option_com->skin = $config->comment_editor_skin;
     $option_com->content_key_name = 'dummy_content2';
     $option_com->primary_key_name = 'dummy_key2';
     $option_com->content_style = $config->comment_content_style;
     $option_com->colorset = $config->sel_comment_editor_colorset;
     $editor_comment = $oEditorModel->getEditor(0, $option_com);
     Context::set('preview_editor_comment', $editor_comment);
     Context::set('editor_config', $editor_config);
     Context::set('editor_skin_list', $editor_skin_list);
     Context::set('editor_colorset_list', $skin_info->colorset);
     Context::set('content_style_list', $content_style_list);
     Context::set('component_list', $component_list);
     Context::set('component_count', $component_count);
     Context::set('editor_config_default', $editor_config_default);
     foreach ($config->additional_css as $additional_css_url) {
         Context::loadFile(array($additional_css_url));
     }
     $security = new Security();
     $security->encodeHTML('component_list....');
     $this->setTemplatePath($this->module_path . 'tpl');
     $this->setTemplateFile('admin_index');
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:101,代码来源:editor.admin.view.php

示例8: compile

 /**
  * Compile a xml_file only when a corresponding js file does not exists or is outdated
  * @return void Returns NULL regardless of the success of failure of the operation
  */
 function compile()
 {
     if (!file_exists($this->xml_file)) {
         return;
     }
     if (!file_exists($this->js_file)) {
         $this->_compile();
     } else {
         if (filemtime($this->xml_file) > filemtime($this->js_file)) {
             $this->_compile();
         }
     }
     Context::loadFile(array($this->js_file, 'body', '', null));
 }
开发者ID:kimkucheol,项目名称:xe-core,代码行数:18,代码来源:XmlJsFilter.class.php

示例9: inlineDisplay

        function inlineDisplay()
        {
            unset($_SESSION['captcha_authed']);
            $this->createKeyword();
            $swfURL = getUrl() . 'addons/captcha/swf/play.swf';
            Context::unloadFile('./addons/captcha/captcha.min.js');
            Context::loadFile(array('./addons/captcha/inline_captcha.js', 'body'));
            global $lang;
            $tags = <<<EOD
<img src="%s" id="captcha_image" alt="CAPTCHA" width="240" height="50" style="width:240px; height:50px; border:1px solid #b0b0b0" />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="0" height="0" id="captcha_audio" align="middle">
\t<param name="allowScriptAccess" value="always" />
\t<param name="quality" value="high" />
\t<param name="movie" value="%s" />
\t<param name="wmode" value="window" />
\t<param name="allowFullScreen" value="false">
\t<param name="bgcolor" value="#fffff" />
\t<embed src="%s" quality="high" wmode="window" allowFullScreen="false" bgcolor="#ffffff" width="0" height="0" name="captcha_audio" align="middle" allowScriptAccess="always" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>
<button type="button" class="captchaReload text">%s</button>
<button type="button" class="captchaPlay text">%s</button><br />
<input type="hidden" name="captchaType" value="inline" />
<input name="secret_text" type="text" id="secret_text" />
EOD;
            $tags = sprintf($tags, getUrl('captcha_action', 'captchaImage', 'rand', mt_rand(10000, 99999)), $swfURL, $swfURL, $lang->reload, $lang->play);
            return $tags;
        }
开发者ID:relip,项目名称:xe-core,代码行数:27,代码来源:captcha.addon.php

示例10: getController

 * Message/Friend munus are added on the pop-up window and member profile. Check if a new message is received
 * */
if ($this->module != 'member' && $called_position == 'before_module_init') {
    // Load a language file from the communication module
    Context::loadLang(_XE_PATH_ . 'modules/communication/lang');
    // Add menus on the member login information
    $oMemberController = getController('member');
    $oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
    $oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
    $flag_file = _XE_PATH_ . 'files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl) . $logged_info->member_srl;
    if ($addon_info->use_alarm != 'N' && file_exists($flag_file)) {
        // Pop-up to display messages if a flag on new message is set
        $new_message_count = (int) trim(FileHandler::readFile($flag_file));
        FileHandler::removeFile($flag_file);
        Context::loadLang(_XE_PATH_ . 'addons/member_communication/lang');
        Context::loadFile(array('./addons/member_communication/tpl/member_communication.js'), true);
        $text = preg_replace('@\\r?\\n@', '\\n', addslashes(Context::getLang('alert_new_message_arrived')));
        Context::addHtmlFooter("<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>");
    }
} elseif ($this->act == 'getMemberMenu' && $called_position == 'before_module_proc') {
    $member_srl = Context::get('target_srl');
    $oCommunicationModel = getModel('communication');
    // Add a feature to display own message box.
    if ($logged_info->member_srl == $member_srl) {
        $mid = Context::get('cur_mid');
        $oMemberController = getController('member');
        // Add your own viewing Note Template
        $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationMessages'), 'cmd_view_message_box', '', 'self');
        // Display a list of friends
        $oMemberController->addMemberPopupMenu(getUrl('', 'mid', $mid, 'act', 'dispCommunicationFriend'), 'cmd_view_friend', '', 'self');
        // If not, Add menus to send message and to add friends
开发者ID:ddmshu,项目名称:xe-core,代码行数:31,代码来源:member_communication.addon.php

示例11:

<?php

/* Copyright (C) misol and Rhymix contributors */
if (!defined('RX_VERSION')) {
    exit;
}
/**
 * @file rx_photoswipe.addon.php
 * @author MinSoo Kim <misol.kr@gmail.com>
 * @brief Add-on to highlight an activated image.
 */
if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && Context::get('module') != 'admin' && !isCrawler()) {
    Context::loadFile(array('./addons/photoswipe/PhotoSwipe/photoswipe.css', '', '', null), true);
    Context::loadFile(array('./addons/photoswipe/PhotoSwipe/default-skin/default-skin.css', '', '', null), true);
    Context::loadFile(array('./addons/photoswipe/PhotoSwipe/photoswipe.js', 'body', '', null), true);
    Context::loadFile(array('./addons/photoswipe/PhotoSwipe/photoswipe-ui-default.js', 'body', '', null), true);
    Context::loadFile(array('./addons/photoswipe/rx_photoswipe.js', 'body', '', null), true);
    $footer = FileHandler::readFile('./addons/photoswipe/PhotoSwipe/pswp.html');
    Context::addHtmlFooter($footer);
}
/* End of file photoswipe.addon.php */
/* Location: ./addons/photoswipe/photoswipe.addon.php */
开发者ID:rhymix,项目名称:rhymix,代码行数:22,代码来源:photoswipe.addon.php

示例12: doActivateFaceOff

 /**
  * faceOff related services for the operation run out
  * @deprecated
  * @param object $layout_info
  * @return void
  */
 function doActivateFaceOff(&$layout_info)
 {
     $layout_info->faceoff_ini_config = $this->getUserLayoutIniConfig($layout_info->layout_srl, $layout_info->layout);
     // faceoff layout CSS
     Context::addCSSFile($this->getDefaultLayoutCss($layout_info->layout));
     // CSS generated in the layout manager
     $faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl);
     if ($faceoff_layout_css) {
         Context::addCSSFile($faceoff_layout_css);
     }
     // CSS output for the widget
     Context::loadFile($this->module_path . '/tpl/css/widget.css', true);
     if ($layout_info->extra_var->colorset->value == 'black') {
         Context::loadFile($this->module_path . '/tpl/css/widget@black.css', true);
     } else {
         Context::loadFile($this->module_path . '/tpl/css/widget@white.css', true);
     }
     // Different page displayed upon user's permission
     $logged_info = Context::get('logged_info');
     // Display edit button for faceoff layout
     if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
         Context::addHtmlFooter('<div class="faceOffManager" style="height: 23px; position: fixed; right: 3px; top: 3px;"><a href="' . getUrl('', 'mid', Context::get('mid'), 'act', 'dispLayoutAdminLayoutModify', 'delete_tmp', 'Y') . '">' . lang('cmd_layout_edit') . '</a></div>');
     }
     // Display menu when editing the faceOff page
     if (Context::get('act') == 'dispLayoutAdminLayoutModify' && ($logged_info->is_admin == 'Y' || $logged_info->is_site_admin)) {
         $oTemplate =& TemplateHandler::getInstance();
         Context::addBodyHeader($oTemplate->compile($this->module_path . '/tpl', 'faceoff_layout_menu'));
     }
 }
开发者ID:rhymix,项目名称:rhymix,代码行数:35,代码来源:layout.model.php

示例13:

<?php

/* Copyright (C) NAVER <http://www.navercorp.com> */
if (!defined('__XE__')) {
    exit;
}
/**
 * @file autolink.addon.php
 * @author NAVER (developers@xpressengine.com)
 * @brief Automatic link add-on
 */
if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML") {
    Context::loadFile(array('./addons/autolink/autolink.js', 'body', '', null), true);
}
/* End of file autolink.addon.php */
/* Location: ./addons/autolink/autolink.addon.php */
开发者ID:rhymix,项目名称:rhymix,代码行数:16,代码来源:autolink.addon.php

示例14:

<?php

/* Copyright (C) NAVER <http://www.navercorp.com> */
if (!defined('__XE__')) {
    exit;
}
if ($called_position == 'after_module_proc' && Context::getResponseMethod() == 'HTML') {
    Context::loadFile('./addons/oembed/jquery.oembed.css');
    Context::loadFile(array('./addons/oembed/jquery.oembed.js', 'body', '', null), true);
    Context::loadFile(array('./addons/oembed/oembed.js', 'body', '', null), true);
}
/* End of file */
开发者ID:rubythonode,项目名称:xe-core,代码行数:12,代码来源:oembed.addon.php

示例15: getOrderFormInputHtml

    function getOrderFormInputHtml($item_info)
    {
        $extend_form_list = $this->getCombineOrderForm($item_info);
        $args->module_srl = $item_info->module_srl;
        $output = $this->executeQueryArray('getItemExtraList', $args);
        if (!$output->toBool()) {
            return $output;
        }
        $extra_vars = $output->data;
        $formTags = array();
        if (!$extra_vars) {
            return $formTags;
        }
        foreach ($extra_vars as $no => $formInfo) {
            unset($formTag);
            $inputTag = '';
            $formTag->title = $formInfo->column_title;
            if ($formInfo->required == 'Y') {
                $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
            }
            $formTag->column_name = $formInfo->column_name;
            $formTag->column_title = $formInfo->column_title;
            $extendForm = $extend_form_list[$formInfo->extra_srl];
            $replace = array('column_name' => $extendForm->column_name, 'value' => $extendForm->value);
            $extentionReplace = array();
            if ($extendForm->column_type == 'text' || $extendForm->column_type == 'homepage' || $extendForm->column_type == 'email_address') {
                $template = '<input type="text" name="%column_name%" value="%value%" />';
            } else {
                if ($extendForm->column_type == 'tel') {
                    $extentionReplace = array('tel_0' => $extendForm->value[0], 'tel_1' => $extendForm->value[1], 'tel_2' => $extendForm->value[2]);
                    $template = '<input type="text" name="%column_name%[]" value="%tel_0%" size="4" />-<input type="text" name="%column_name%[]" value="%tel_1%" size="4" />-<input type="text" name="%column_name%" value="%tel_2%" size="4" />';
                } else {
                    if ($extendForm->column_type == 'textarea') {
                        $template = '<textarea name="%column_name%">%value%</textarea>';
                    } else {
                        if ($extendForm->column_type == 'checkbox') {
                            $template = '';
                            if ($extendForm->default_value) {
                                $__i = 0;
                                foreach ($extendForm->default_value as $v) {
                                    $checked = '';
                                    if (is_array($extendForm->value) && in_array($v, $extendForm->value)) {
                                        $checked = 'checked="checked"';
                                    }
                                    $template .= '<input type="checkbox" id="%column_name%' . $__i . '" name="%column_name%[]" value="' . htmlspecialchars($v) . '" ' . $checked . ' /><label for="%column_name%' . $__i . '">' . $v . '</label>';
                                    $__i++;
                                }
                            }
                        } else {
                            if ($extendForm->column_type == 'radio') {
                                $template = '';
                                if ($extendForm->default_value) {
                                    $template = '<ul class="radio">%s</ul>';
                                    $optionTag = array();
                                    foreach ($extendForm->default_value as $v) {
                                        if ($extendForm->value == $v) {
                                            $checked = 'checked="checked"';
                                        } else {
                                            $checked = '';
                                        }
                                        $optionTag[] = '<li><input type="radio" name="%column_name%" value="' . $v . '" ' . $checked . ' />' . $v . '</li>';
                                    }
                                    $template = sprintf($template, implode('', $optionTag));
                                }
                            } else {
                                if ($extendForm->column_type == 'select') {
                                    $template = '<select name="' . $formInfo->column_name . '">%s</select>';
                                    $optionTag = array();
                                    if ($extendForm->default_value) {
                                        foreach ($extendForm->default_value as $v) {
                                            if ($v == $extendForm->value) {
                                                $selected = 'selected="selected"';
                                            } else {
                                                $selected = '';
                                            }
                                            $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $v, $selected, $v);
                                        }
                                    }
                                    $template = sprintf($template, implode('', $optionTag));
                                } else {
                                    if ($extendForm->column_type == 'date') {
                                        $extentionReplace = array('date' => zdate($extendForm->value, 'Y-m-d'), 'cmd_delete' => $lang->cmd_delete);
                                        $template = '<input type="hidden" name="%column_name%" id="date_%column_name%" value="%value%" /><input type="text" class="inputDate" value="%date%" readonly="readonly" /> <input type="button" value="%cmd_delete%" class="dateRemover" />' . '<script type="text/javascript">' . "\n" . '(function($){' . "\n" . '    $(function(){' . "\n" . '        var option = { dateFormat: "yy-mm-dd", changeMonth:true, changeYear:true, gotoCurrent: false,yearRange:\'-100:+10\', onSelect:function(){' . "\n" . '            $(this).prev(\'input[type="hidden"]\').val(this.value.replace(/-/g,""))}' . "\n" . '        };' . "\n" . '        $.extend(option,$.datepicker.regional[\'' . Context::getLangType() . '\']);' . "\n" . '        $("#date_%column_name%").datepicker(option);' . "\n" . '               $("#dateRemover_%column_name%").click(function(){' . "\n" . '                       $(this).siblings("input").val("");' . "\n" . '                       return false;' . "\n" . '               })' . "\n" . '    });' . "\n" . '})(jQuery);' . "\n" . '</script>';
                                    } else {
                                        if ($extendForm->column_type == 'kr_zip') {
                                            Context::loadFile(array('./modules/member/tpl/js/krzip_search.js', 'body'), true);
                                            $extentionReplace = array('msg_kr_address' => $lang->msg_kr_address, 'msg_kr_address_etc' => $lang->msg_kr_address_etc, 'cmd_search' => $lang->cmd_search, 'cmd_search_again' => $lang->cmd_search_again, 'addr_0' => $extendForm->value[0], 'addr_1' => $extendForm->value[1]);
                                            $replace = array_merge($extentionReplace, $replace);
                                            $template = <<<EOD
\t\t\t\t<div class="krZip">
\t\t\t\t\t<div class="a" id="zone_address_search_%column_name%" >
\t\t\t\t\t\t<label for="krzip_address1_%column_name%">%msg_kr_address%</label><br />
\t\t\t\t\t\t<input type="text" id="krzip_address1_%column_name%" value="%addr_0%" />
\t\t\t\t\t\t<button type="button">%cmd_search%</button>
\t\t\t\t\t</div>
\t\t\t\t\t<div class="a" id="zone_address_list_%column_name%" style="display:none">
\t\t\t\t\t\t<select name="%column_name%[]" id="address_list_%column_name%"><option value="%addr_0%">%addr_0%</select>
\t\t\t\t\t\t<button type="button">%cmd_search_again%</button>
\t\t\t\t\t</div>
\t\t\t\t\t<div class="a address2">
//.........这里部分代码省略.........
开发者ID:umjinsun12,项目名称:dngshin,代码行数:101,代码来源:ncart.model.php


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