/**
  * @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);
     }
 }
Example #2
0
 /**
  * @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');
     }
 }
Example #3
0
 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);
     }
 }
 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();
 }
 /**
  * @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');
 }
Example #6
0
<?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 */
Example #7
0
 /**
  * @brief Administrator Setting page
  * Settings to enable/disable editor component and other features
  */
 function dispEditorAdminIndex()
 {
     $component_count = 0;
     $site_module_info = Context::get('site_module_info');
     $site_srl = (int) $site_module_info->site_srl;
     // Get a type of component
     $oEditorModel = getModel('editor');
     $oModuleModel = getModel('module');
     $editor_config = $oModuleModel->getModuleConfig('editor');
     if (!$editor_config) {
         $editor_config = new stdClass();
     }
     //editor_config init
     if (!$editor_config->editor_height) {
         $editor_config->editor_height = 300;
     }
     if (!$editor_config->comment_editor_height) {
         $editor_config->comment_editor_height = 100;
     }
     if (!$editor_config->editor_skin) {
         $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');
 }
Example #8
0
 /**
  * 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));
 }
Example #9
0
        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;
        }
 * 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
Example #11
0
<?php

/* Copyright (C) misol and Rhymix contributors */
if (!defined('RX_VERSION')) {
    exit;
}
/**
 * @file rx_photoswipe.addon.php
 * @author MinSoo Kim <*****@*****.**>
 * @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 */
Example #12
0
 /**
  * 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'));
     }
 }
Example #13
0
<?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 */
Example #14
0
<?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 */
Example #15
0
    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">
\t\t\t\t\t\t<label for="krzip_address2_%column_name%">%msg_kr_address_etc%</label><br />
\t\t\t\t\t\t<input type="text" name="%column_name%[]" id="krzip_address2_%column_name%" value="%addr_1%" />
\t\t\t\t\t</div>
\t\t\t\t</div>
\t\t\t\t<script type="text/javascript">jQuery(function(\$){ \$.krzip('%column_name%') });</script>
EOD;
                                        }
                                    }
                                }
                            }
                        }
                    }
                }
            }
            $replace = array_merge($extentionReplace, $replace);
            $inputTag = preg_replace('@%(\\w+)%@e', '$replace[$1]', $template);
            if ($extendForm->description) {
                $inputTag .= '<p style="color:#999;">' . htmlspecialchars($extendForm->description) . '</p>';
            }
            $formTag->inputTag = $inputTag;
            $formTags[] = $formTag;
        }
        return $formTags;
    }
 function triggerBeforeDisplay(&$output)
 {
     if (Context::getResponseMethod() == 'HTML') {
         $mid = Context::get('mid');
         if ($mid) {
             $oAjaxboardModel = getModel('ajaxboard');
             $plugins_info = $oAjaxboardModel->getPluginsInfoByMid($mid, Mobile::isFromMobilePhone());
             if (count($plugins_info)) {
                 $module_config = $oAjaxboardModel->getConfig();
                 if ($module_config->type == 1) {
                     Context::loadFile($this->module_path . 'tpl/js/libs/socket.io.js', 'head');
                 }
                 Context::loadFile($this->module_path . 'tpl/js/libs/eventsource.js', 'head');
                 Context::loadFile($this->module_path . 'tpl/js/client.js', 'head');
                 $oTemplate = TemplateHandler::getInstance();
                 Context::set('waiting_message', $module_config->waiting_message);
                 Context::set('module_config', $oAjaxboardModel->getTemplateConfig());
                 $compile = $oTemplate->compile($this->module_path . 'tpl', 'templateConfig');
                 $output .= $compile;
                 $logged_info = Context::get('logged_info');
                 $user_info = $oAjaxboardModel->getFilterUserInfo($logged_info->member_srl);
                 Context::set('user_info', $user_info);
                 foreach ($plugins_info as $plugin_info) {
                     Context::set('plugin_info', $plugin_info);
                     $plugin_name = $plugin_info->plugin_name;
                     $plugin_path = $this->module_path . 'plugins/' . $plugin_name;
                     $compile = $oTemplate->compile($plugin_path, 'plugin');
                     $output .= $compile;
                 }
             }
         }
     }
     return new Object();
 }
Example #17
0
 function loadDefaultComponents($targets = 'client')
 {
     if (is_string($targets)) {
         $targets = array($targets);
     }
     $module_config = $this->getConfig();
     $files = array();
     $files[] = array(sprintf('%stpl/js/libs/intrinsic.function.js', $this->module_path), 'head', NULL, 0);
     if ($module_config->use_cdn == 'Y') {
         $files[] = array(sprintf('///cdn.socket.io/socket.io-%s.js', self::socket_io_version), 'head', NULL, -100000);
     } else {
         $files[] = array(sprintf('%stpl/js/libs/socket.io.js', $this->module_path), 'head', NULL, -100000);
     }
     foreach ($targets as $target) {
         $files[] = array(sprintf('%stpl/js/ajaxboard.%s.js', $this->module_path, $target), 'head', NULL, 0);
     }
     foreach ($files as $file) {
         Context::loadFile($file);
     }
 }
Example #18
0
 /**
  * add given .css or .js file names in widget code to Context
  * @param array $matches
  * @return void
  */
 function _transMeta($matches)
 {
     if ($matches[1]) {
         return '';
     }
     Context::loadFile($matches[2]);
 }
 function _addFile()
 {
     $oModuleModel = getModel('module');
     $module_info = $oModuleModel->getModuleInfoXml('ncenterlite');
     if (file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.css'))) {
         Context::addCssFile($this->template_path . 'ncenterlite.css', true, 'all', '', 100);
     }
     $oNcenterliteModel = getModel('ncenterlite');
     $config = $oNcenterliteModel->getConfig();
     if (!Mobile::isFromMobilePhone()) {
         if ($config->colorset && file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.' . $config->colorset . '.css'))) {
             Context::addCssFile($this->template_path . 'ncenterlite.' . $config->colorset . '.css', true, 'all', '', 100);
         }
     } elseif (Mobile::isFromMobilePhone()) {
         if ($config->mcolorset && file_exists(FileHandler::getRealPath($this->template_path . 'ncenterlite.' . $config->mcolorset . '.css'))) {
             Context::addCssFile($this->template_path . 'ncenterlite.' . $config->mcolorset . '.css', true, 'all', '', 100);
         }
         Context::loadFile(array('./common/js/jquery.min.js', 'head', '', -100000), true);
         Context::loadFile(array('./common/js/xe.min.js', 'head', '', -100000), true);
         Context::addCssFile($this->template_path . 'ncenterlite.mobile.css', true, 'all', '', 100);
     }
     if ($config->zindex) {
         Context::set('ncenterlite_zindex', ' style="z-index:' . $config->zindex . ';" ');
     }
 }
Example #20
0
 /**
  * import common .js and .css files for (both desktop and mobile)
  */
 private function _loadCommonJSCSS()
 {
     Context::loadFile(array('./common/css/rhymix.scss', '', '', -1600000), true);
     $original_file_list = array('x', 'common', 'js_app', 'xml_handler', 'xml_js_filter');
     $jquery_version = preg_match('/MSIE [5-8]\\./', $_SERVER['HTTP_USER_AGENT']) ? '1.11.3' : '2.1.4';
     if (config('view.minify_scripts') === 'none') {
         Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.js', 'head', '', -1730000), true);
         Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.js', 'head', '', -1720000), true);
         foreach ($original_file_list as $filename) {
             Context::loadFile(array('./common/js/' . $filename . '.js', 'head', '', -1700000), true);
         }
     } else {
         Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.min.js', 'head', '', -1730000), true);
         Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.min.js', 'head', '', -1720000), true);
         $concat_target_filename = 'files/cache/assets/minified/rhymix.min.js';
         if (file_exists(\RX_BASEDIR . $concat_target_filename)) {
             $concat_target_mtime = filemtime(\RX_BASEDIR . $concat_target_filename);
             $original_mtime = 0;
             foreach ($original_file_list as $filename) {
                 $original_mtime = max($original_mtime, filemtime(\RX_BASEDIR . 'common/js/' . $filename . '.js'));
             }
             if ($concat_target_mtime > $original_mtime) {
                 Context::loadFile(array('./' . $concat_target_filename, 'head', '', -100000), true);
                 return;
             }
         }
         Rhymix\Framework\Formatter::minifyJS(array_map(function ($str) {
             return \RX_BASEDIR . 'common/js/' . $str . '.js';
         }, $original_file_list), \RX_BASEDIR . $concat_target_filename);
         Context::loadFile(array('./' . $concat_target_filename, 'head', '', -100000), true);
     }
 }
Example #21
0
    /**
     * Get tags by the member info type 
     *
     * @param object $memberInfo
     * @param boolean $isAdmin (true : admin, false : not admin)
     *
     * @return array
     **/
    function _getMemberInputTag($memberInfo, $isAdmin = false)
    {
        $oMemberModel =& getModel('member');
        $extend_form_list = $oMemberModel->getCombineJoinForm($memberInfo);
        if ($memberInfo) {
            $memberInfo = get_object_vars($memberInfo);
        }
        $member_config = $oMemberModel->getMemberConfig();
        $formTags = array();
        global $lang;
        foreach ($member_config->signupForm as $no => $formInfo) {
            if (!$formInfo->isUse) {
                continue;
            }
            if ($formInfo->name == $member_config->identifier || $formInfo->name == 'password') {
                continue;
            }
            unset($formTag);
            $inputTag = '';
            $formTag->title = $formInfo->isDefaultForm ? $lang->{$formInfo->name} : $formInfo->title;
            if ($isAdmin) {
                if ($formInfo->mustRequired) {
                    $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
                }
            } else {
                if ($formInfo->required && $formInfo->name != 'password') {
                    $formTag->title = $formTag->title . ' <em style="color:red">*</em>';
                }
            }
            $formTag->name = $formInfo->name;
            if ($formInfo->isDefaultForm) {
                if ($formInfo->imageType) {
                    if ($formInfo->name == 'profile_image') {
                        $target = $memberInfo['profile_image'];
                        $functionName = 'doDeleteProfileImage';
                    } elseif ($formInfo->name == 'image_name') {
                        $target = $memberInfo['image_name'];
                        $functionName = 'doDeleteImageName';
                    } elseif ($formInfo->name == 'image_mark') {
                        $target = $memberInfo['image_mark'];
                        $functionName = 'doDeleteImageMark';
                    }
                    if ($target->src) {
                        $inputTag = sprintf('<p class="a"><input type="hidden" name="__%s_exist" value="true" /><span id="%s"><img src="%s" alt="%s" /> <button type="button" class="text" onclick="%s(%d);return false;">%s</button></span></p>', $formInfo->name, $formInfo->name . 'tag', $target->src, $formInfo->title, $functionName, $memberInfo['member_srl'], $lang->cmd_delete);
                    } else {
                        $inputTag = sprintf('<input type="hidden" name="__%s_exist" value="false" />', $formInfo->name);
                    }
                    $inputTag .= sprintf('<p class="a"><input type="file" name="%s" id="%s" value="" /></p><p><span class="desc">%s : %dpx, %s : %dpx</span></p>', $formInfo->name, $formInfo->name, $lang->{$formInfo->name . '_max_width'}, $member_config->{$formInfo->name . '_max_width'}, $lang->{$formInfo->name . '_max_height'}, $member_config->{$formInfo->name . '_max_height'});
                } elseif ($formInfo->name == 'birthday') {
                    $inputTag = sprintf('<input type="hidden" name="birthday" id="date_birthday" value="%s" /><input type="text" class="inputDate" id="birthday" value="%s" /> <input type="button" value="%s" class="dateRemover" />', $memberInfo['birthday'], zdate($memberInfo['birthday'], 'Y-m-d', false), $lang->cmd_delete);
                } elseif ($formInfo->name == 'find_account_question') {
                    $inputTag = '<select name="find_account_question" style="width:290px; display:block;">%s</select>';
                    $optionTag = array();
                    foreach ($lang->find_account_question_items as $key => $val) {
                        if ($key == $memberInfo['find_account_question']) {
                            $selected = 'selected="selected"';
                        } else {
                            $selected = '';
                        }
                        $optionTag[] = sprintf('<option value="%s" %s >%s</option>', $key, $selected, $val);
                    }
                    $inputTag = sprintf($inputTag, implode('', $optionTag));
                    $inputTag .= '<input type="text" name="find_account_answer" title="' . Context::getLang('find_account_answer') . '" value="' . $memberInfo['find_account_answer'] . '" class="inputText long tall" />';
                } else {
                    $inputTag = sprintf('<input type="text" name="%s" value="%s" class="inputText long tall" />', $formInfo->name, $memberInfo[$formInfo->name]);
                }
            } else {
                $extendForm = $extend_form_list[$formInfo->member_join_form_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%" />';
                } elseif ($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" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_1%" size="4" maxlength="4" style="width:30px" />-<input type="text" name="%column_name%[]" value="%tel_2%" size="4" maxlength="4" style="width:30px" />';
                } elseif ($extendForm->column_type == 'textarea') {
                    $template = '<textarea name="%column_name%" rows="8" cols="42">%value%</textarea>';
                } elseif ($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++;
                        }
                    }
                } elseif ($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));
                    }
                } elseif ($extendForm->column_type == 'select') {
                    $template = '<select name="' . $formInfo->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));
                } elseif ($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\t\t<div class="krZip">
\t\t\t\t\t\t\t<div class="a" id="zone_address_search_%column_name%" >
\t\t\t\t\t\t\t\t<label for="krzip_address1_%column_name%">%msg_kr_address%</label><br />
\t\t\t\t\t\t\t\t<input type="text" id="krzip_address1_%column_name%" value="%addr_0%" />
\t\t\t\t\t\t\t\t<button type="button">%cmd_search%</button>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class="a" id="zone_address_list_%column_name%" style="display:none">
\t\t\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\t\t<button type="button">%cmd_search_again%</button>
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t\t<div class="a address2">
\t\t\t\t\t\t\t\t<label for="krzip_address2_%column_name%">%msg_kr_address_etc%</label><br />
\t\t\t\t\t\t\t\t<input type="text" name="%column_name%[]" id="krzip_address2_%column_name%" value="%addr_1%" />
\t\t\t\t\t\t\t</div>
\t\t\t\t\t\t</div>
\t\t\t\t\t\t<script type="text/javascript">jQuery(function(\$){ \$.krzip('%column_name%') });</script>
EOD;
                } elseif ($extendForm->column_type == 'jp_zip') {
                    $template = '<input type="text" name="%column_name%" value="%value%" />';
                } elseif ($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" />';
                }
                $replace = array_merge($extentionReplace, $replace);
                $inputTag = preg_replace('@%(\\w+)%@e', '$replace[$1]', $template);
                if ($extendForm->description) {
                    $inputTag .= '<p style="color:#999;">' . htmlspecialchars($extendForm->description) . '</p>';
                }
            }
            $formTag->inputTag = $inputTag;
            $formTags[] = $formTag;
        }
        return $formTags;
    }
    exit;
}
?>
<script>
xe.lang.msg_empty_search_target = '<?php 
echo $__Context->lang->msg_empty_search_target;
?>
';
xe.lang.msg_empty_search_keyword = '<?php 
echo $__Context->lang->msg_empty_search_keyword;
?>
';
</script>
<!--#Meta:modules/file/tpl/js/file_admin.js--><?php 
$__tmp = array('modules/file/tpl/js/file_admin.js', '', '', '');
Context::loadFile($__tmp);
unset($__tmp);
?>
<form id="fo_list" action="./" method="post"><input type="hidden" name="error_return_url" value="<?php 
echo htmlspecialchars(getRequestUriByServerEnviroment(), ENT_COMPAT | ENT_HTML401, 'UTF-8', false);
?>
" /><input type="hidden" name="act" value="<?php 
echo $__Context->act;
?>
" /><input type="hidden" name="mid" value="<?php 
echo $__Context->mid;
?>
" /><input type="hidden" name="vid" value="<?php 
echo $__Context->vid;
?>
" />
Example #23
0
 /**
  * import common .js and .css files for (both desktop and mobile)
  */
 private function _loadCommonJSCSS()
 {
     Context::loadFile(array('./common/css/xe.css', '', '', -1600000), true);
     $original_file_list = array('x', 'common', 'js_app', 'xml_handler', 'xml_js_filter');
     $jquery_version = preg_match('/MSIE [5-8]\\./', $_SERVER['HTTP_USER_AGENT']) ? '1.11.3' : '2.1.4';
     if (config('view.minify_scripts') === 'none') {
         Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.js', 'head', '', -1730000), true);
         Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.js', 'head', '', -1720000), true);
         foreach ($original_file_list as $filename) {
             Context::loadFile(array('./common/js/' . $filename . '.js', 'head', '', -1700000), true);
         }
     } else {
         Context::loadFile(array('./common/js/jquery-' . $jquery_version . '.min.js', 'head', '', -1730000), true);
         Context::loadFile(array('./common/js/plugins/jquery.migrate/jquery-migrate-1.2.1.min.js', 'head', '', -1720000), true);
         $concat_target_filename = 'files/cache/minify/xe.min.js';
         if (file_exists(_XE_PATH_ . $concat_target_filename)) {
             $concat_target_mtime = filemtime(_XE_PATH_ . $concat_target_filename);
             $original_mtime = 0;
             foreach ($original_file_list as $filename) {
                 $original_mtime = max($original_mtime, filemtime(_XE_PATH_ . 'common/js/' . $filename . '.js'));
             }
             if ($concat_target_mtime > $original_mtime) {
                 Context::loadFile(array('./' . $concat_target_filename, 'head', '', -100000), true);
                 return;
             }
         }
         $minifier = new MatthiasMullie\Minify\JS();
         foreach ($original_file_list as $filename) {
             $minifier->add(_XE_PATH_ . 'common/js/' . $filename . '.js');
         }
         FileHandler::writeFile(_XE_PATH_ . $concat_target_filename, $minifier->execute());
         Context::loadFile(array('./' . $concat_target_filename, 'head', '', -100000), true);
     }
 }