本文整理汇总了PHP中Context::addHtmlFooter方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::addHtmlFooter方法的具体用法?PHP Context::addHtmlFooter怎么用?PHP Context::addHtmlFooter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::addHtmlFooter方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __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&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);
}
}
示例2: transHTML
/**
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 그 코드를 html로 변경하여 주는 method
*
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
**/
function transHTML($xml_obj)
{
$code_type = $xml_obj->attrs->code_type;
$option_file_path = $xml_obj->attrs->file_path;
$option_description = $xml_obj->attrs->description;
$option_first_line = $xml_obj->attrs->first_line;
$option_collapse = $xml_obj->attrs->collapse;
$option_nogutter = $xml_obj->attrs->nogutter;
$option_nocontrols = $xml_obj->attrs->nocontrols;
if ($option_collapse == 'true') {
$option = $option . 'collapse: true;';
}
if ($option_nogutter == 'true') {
$option = $option . 'gutter: false;';
}
if ($option_nocontrols == 'true' && $option_collapse != 'true') {
$option = $option . 'toolbar: false;';
}
if ($option_first_line > 1) {
$option = $option . "first-line: " . $option_first_line . ";";
}
$body = $xml_obj->body;
$body = preg_replace('@(<br\\s?/?>)(\\n)?@i', "\n", $body);
$body = strip_tags($body);
if (!$GLOBALS['_called_editor_component_code_highlighter_']) {
$GLOBALS['_called_editor_component_code_highlighter_'] = true;
$js_code = <<<dpScript
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = '{$this->component_path}script/clipboard.swf';
SyntaxHighlighter.all();
</script>
dpScript;
Context::addHtmlFooter($js_code);
Context::addCSSFile($this->component_path . 'style/shCore.css');
Context::addCSSFile($this->component_path . 'style/shThemeDefault.css');
Context::addJsFile($this->component_path . 'script/shCore.js');
}
Context::addJsFile($this->component_path . 'script/shBrush' . $code_type . '.js');
$output = null;
if ($option_file_path != null || $option_description != null) {
$output .= '<div class="ch_infobox">';
if ($option_file_path != null) {
$output .= '<span class="file_path">' . $option_file_path . '</span>';
}
if ($option_description != null) {
$output .= '<span class="description">' . $option_description . '</span>';
}
$output .= '</div>';
}
$output .= sprintf('<pre class="brush: %s;%s">%s</pre>', strtolower($code_type), $option, $body);
return $output;
}
示例3: showSendEnv
/**
* Enviroment information send to XE collect server
* @return void
*/
function showSendEnv()
{
if (Context::getResponseMethod() != 'HTML') {
return;
}
$server = 'http://collect.xpressengine.com/env/img.php?';
$path = './files/env/';
$install_env = $path . 'install';
$mainVersion = join('.', array_slice(explode('.', __XE_VERSION__), 0, 2));
if (file_exists(FileHandler::getRealPath($install_env))) {
$oAdminAdminModel = getAdminModel('admin');
$params = $oAdminAdminModel->getEnv('INSTALL');
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
Context::addHtmlFooter($img);
FileHandler::writeFile($path . $mainVersion, '1');
} else {
if (isset($_SESSION['enviroment_gather']) && !file_exists(FileHandler::getRealPath($path . $mainVersion))) {
if ($_SESSION['enviroment_gather'] == 'Y') {
$oAdminAdminModel = getAdminModel('admin');
$params = $oAdminAdminModel->getEnv();
$img = sprintf('<img src="%s" alt="" style="height:0px;width:0px" />', $server . $params);
Context::addHtmlFooter($img);
}
FileHandler::writeFile($path . $mainVersion, '1');
unset($_SESSION['enviroment_gather']);
}
}
}
示例4: str_replace
<?php
/*
new_document_notify2.addon.php
notify after check new document
*/
if (!defined('__XE__')) {
exit;
}
if ($called_position == 'before_module_proc' && Context::get('module') != 'admin' && Context::get('act') != 'getFileList' && Context::get('act') != 'procFileUpload') {
$delay = str_replace("ms", "", $addon_info->delay);
if (!isset($addon_info->notifysound)) {
$addon_info->notifysound = "false";
}
Context::addHtmlHeader('<script src="https://cdn.socket.io/socket.io-1.0.3.js"></script>');
Context::addHtmlFooter('<script src="./addons/new_document_notify2/js/new_document_notify.js"></script>');
Context::addCssFile('./addons/new_document_notify2/css/style.css');
Context::addBodyHeader('<div id="notify-div"></div>');
Context::addHtmlHeader('<script type="text/javascript">var socket = io("' . $addon_info->nitrous . '");var delay = ' . $delay . ';var notifysound="' . $addon_info->notifysound . '"; </script>');
if (in_array($this->mid, explode(",", $addon_info->module_id))) {
if (Context::get('act') == "dispBoardWrite" && Context::get('document_srl')) {
$_SESSION['notify_modify'] = 'modify';
} else {
if (Context::get('act') == 'procBoardInsertDocument' && $_SESSION['notify_modify'] == "modify") {
} else {
if ($_SESSION['notify_type'] == 'write') {
$title = $_SESSION['notify_title'];
$srl = $_SESSION['notify_srl'];
unset($_SESSION['notify_type']);
unset($_SESSION['notify_title']);
unset($_SESSION['notify_srl']);
示例5: procModule
//.........这里部分代码省略.........
if ($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) {
$this->act = $xml_info->default_index_act;
} else {
$this->error = 'msg_invalid_request';
$oModule->setError(-1);
$oModule->setMessage($this->error);
return $oModule;
}
}
}
// ruleset check...
if (!empty($ruleset)) {
$rulesetModule = $forward->module ? $forward->module : $this->module;
$rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
if (!empty($rulesetFile)) {
if ($_SESSION['XE_VALIDATOR_ERROR_LANG']) {
$errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG'];
foreach ($errorLang as $key => $val) {
Context::setLang($key, $val);
}
unset($_SESSION['XE_VALIDATOR_ERROR_LANG']);
}
$Validator = new Validator($rulesetFile);
$result = $Validator->validate();
if (!$result) {
$lastError = $Validator->getLastError();
$returnUrl = Context::get('error_return_url');
$errorMsg = $lastError['msg'] ? $lastError['msg'] : 'validation error';
//for xml response
$oModule->setError(-1);
$oModule->setMessage($errorMsg);
//for html redirect
$this->error = $errorMsg;
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = $this->error;
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $returnUrl;
$_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
$this->_setInputValueToSession();
return $oModule;
}
}
}
$oModule->setAct($this->act);
$this->module_info->module_type = $type;
$oModule->setModuleInfo($this->module_info, $xml_info);
$skipAct = array('dispEditorConfigPreview' => 1, 'dispLayoutPreviewWithModule' => 1);
$db_use_mobile = Mobile::isMobileEnabled();
if ($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent() && !isset($skipAct[Context::get('act')]) && $db_use_mobile === true) {
global $lang;
$header = '<style>div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';
$footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' . getUrl('m', '1') . '">' . $lang->msg_pc_to_mobile . '</a></p></div>';
Context::addHtmlHeader($header);
Context::addHtmlFooter($footer);
}
if ($type == "view" && $kind != 'admin') {
$module_config = $oModuleModel->getModuleConfig('module');
if ($module_config->htmlFooter) {
Context::addHtmlFooter($module_config->htmlFooter);
}
if ($module_config->siteTitle) {
$siteTitle = Context::getBrowserTitle();
if (!$siteTitle) {
Context::setBrowserTitle($module_config->siteTitle);
}
}
}
// if failed message exists in session, set context
$this->_setInputErrorToContext();
$procResult = $oModule->proc();
$methodList = array('XMLRPC' => 1, 'JSON' => 1, 'JS_CALLBACK' => 1);
if (!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) {
$error = $oModule->getError();
$message = $oModule->getMessage();
$messageType = $oModule->getMessageType();
$redirectUrl = $oModule->getRedirectUrl();
if ($messageType == 'error') {
debugPrint($message, 'ERROR');
}
if (!$procResult) {
$this->error = $message;
if (!$redirectUrl && Context::get('error_return_url')) {
$redirectUrl = Context::get('error_return_url');
}
$this->_setInputValueToSession();
} else {
}
$_SESSION['XE_VALIDATOR_ERROR'] = $error;
$_SESSION['XE_VALIDATOR_ID'] = Context::get('xe_validator_id');
if ($message != 'success') {
$_SESSION['XE_VALIDATOR_MESSAGE'] = $message;
}
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = $messageType;
if (Context::get('xeVirtualRequestMethod') != 'xml') {
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $redirectUrl;
}
}
unset($logged_info);
return $oModule;
}
示例6: getController
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
} else {
// Get member information
示例7: getController
// Add menus on the member login information
$oMemberController =& getController('member');
$oMemberController->addMemberMenu('dispCommunicationFriend', 'cmd_view_friend');
$oMemberController->addMemberMenu('dispCommunicationMessages', 'cmd_view_message_box');
// Pop-up to display messages if a flag on new message is set
$flag_path = './files/member_extra_info/new_message_flags/' . getNumberingPath($logged_info->member_srl);
$flag_file = $flag_path . $logged_info->member_srl;
if (file_exists($flag_file)) {
$new_message_count = trim(FileHandler::readFile($flag_file));
FileHandler::removeFile($flag_file);
Context::loadLang('./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')));
$link = Context::getRequestUri() . '?module=communication&act=dispCommunicationNewMessage';
$script = "<script type=\"text/javascript\">jQuery(function(){ xeNotifyMessage('{$text}','{$new_message_count}'); });</script>";
Context::addHtmlFooter($script);
}
} elseif ($called_position == 'before_module_proc' && $this->act == 'getMemberMenu') {
$oMemberController =& getController('member');
$member_srl = Context::get('target_srl');
$mid = Context::get('cur_mid');
// Creates communication model object
$oCommunicationModel =& getModel('communication');
// Add a feature to display own message box.
if ($logged_info->member_srl == $member_srl) {
// 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
} else {
示例8: toDoc
/**
* Produce HTML compliant content given a module object.\n
* @param ModuleObject $oModule the module object
* @return string compiled template string
*/
function toDoc(&$oModule)
{
$oTemplate = TemplateHandler::getInstance();
// compile module tpl
// deprecated themes skin
$template_path = $oModule->getTemplatePath();
if (!is_dir($template_path)) {
if ($oModule->module_info->module == $oModule->module) {
$skin = $oModule->origin_module_info->skin;
} else {
$skin = $oModule->module_config->skin;
}
if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') === false) {
if ($skin && is_string($skin)) {
$theme_skin = explode('|@|', $skin);
$template_path = $oModule->getTemplatePath();
if (count($theme_skin) == 2) {
$theme_path = sprintf('./themes/%s', $theme_skin[0]);
// FIXME $theme_path $theme_path $theme_path ??
if (substr($theme_path, 0, strlen($theme_path)) != $theme_path) {
$template_path = sprintf('%s/modules/%s/', $theme_path, $theme_skin[1]);
}
}
} else {
$template_path = $oModule->getTemplatePath();
}
} else {
$template_path = $oModule->getTemplatePath();
}
}
$tpl_file = $oModule->getTemplateFile();
$output = $oTemplate->compile($template_path, $tpl_file);
// add .x div for adminitration pages
if (Context::getResponseMethod() == 'HTML') {
if (Context::get('module') != 'admin' && strpos(Context::get('act'), 'Admin') > 0 && Context::get('act') != 'dispPageAdminContentModify' && Context::get('act') != 'dispPageAdminMobileContentModify') {
$output = '<div class="x">' . $output . '</div>';
}
if (Context::get('layout') != 'none') {
if (__DEBUG__ == 3) {
$start = getMicroTime();
}
Context::set('content', $output, false);
$layout_path = $oModule->getLayoutPath();
$layout_file = $oModule->getLayoutFile();
$edited_layout_file = $oModule->getEditedLayoutFile();
// get the layout information currently requested
$oLayoutModel = getModel('layout');
$layout_info = Context::get('layout_info');
$layout_srl = $layout_info->layout_srl;
// compile if connected to the layout
if ($layout_srl > 0) {
// handle separately if the layout is faceoff
if ($layout_info && $layout_info->type == 'faceoff') {
$oLayoutModel->doActivateFaceOff($layout_info);
Context::set('layout_info', $layout_info);
}
// search if the changes CSS exists in the admin layout edit window
$edited_layout_css = $oLayoutModel->getUserLayoutCss($layout_srl);
if (FileHandler::exists($edited_layout_css)) {
Context::loadFile(array($edited_layout_css, 'all', '', 100));
}
}
if (!$layout_path) {
$layout_path = './common/tpl';
}
if (!$layout_file) {
$layout_file = 'default_layout';
}
$output = $oTemplate->compile($layout_path, $layout_file, $edited_layout_file);
// if popup_layout, remove admin bar.
$realLayoutPath = FileHandler::getRealPath($layout_path);
if (substr_compare($realLayoutPath, '/', -1) !== 0) {
$realLayoutPath .= '/';
}
$pathInfo = pathinfo($layout_file);
$onlyLayoutFile = $pathInfo['filename'];
if ($realLayoutPath === _XE_PATH_ . 'common/tpl/' && $onlyLayoutFile === 'popup_layout') {
Context::set('admin_bar', 'false');
}
// DISABLE ADMIN BAR
Context::set('admin_bar', 'false');
if (__DEBUG__ == 3) {
$GLOBALS['__layout_compile_elapsed__'] = getMicroTime() - $start;
}
if (stripos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE && (Context::get('_use_ssl') == 'optional' || Context::get('_use_ssl') == 'always')) {
Context::addHtmlFooter('<iframe id="xeTmpIframe" name="xeTmpIframe" style="width:1px;height:1px;position:absolute;top:-2px;left:-2px;"></iframe>');
}
}
}
return $output;
}
示例9: alertMessage
/**
* @brief the method for displaying the warning messages
* display an error message if it has not a special design
**/
function alertMessage($message)
{
$script = sprintf('<script> jQuery(function(){ alert("%s"); } );</script>', lang($message));
Context::addHtmlFooter($script);
$this->setHttpStatusCode(403);
}
示例10: format
$np = "@font-face{font-family:np;font-style:normal;font-weight:normal;src:url(http://themes.googleusercontent.com/static/fonts/earlyaccess/nanumpenscript/v2/NanumPenScript-Regular.eot)\\9}";
}
if (!$addon_info->notice) {
Context::addCssFile('./addons/webfont/css/webfont.css');
if (Mobile::isMobileCheckByAgent()) {
Context::addJsFile('./addons/webfont/js/webfont_notice_m.js', false, '', null, 'body');
} else {
Context::addJsFile('./addons/webfont/js/webfont_notice.js', false, '', null, 'body');
}
if (!$addon_info->expires) {
$addon_info->expires = "1";
}
}
}
$fontcheck = "\n<div id=\"fontcheck\" title=\"{$addon_info->expires}\" style=\"position:absolute;top:-999px;left:-999px;visibility:hidden;font-size:72px\">\n\t<p id=\"fontcheck_nanum1\" style=\"float:left;font-family:NanumGothic,나눔고딕,monospace,Verdana !important\">abcXYZ, 세종대왕,1234</p>\n\t<p id=\"fontcheck_nanum2\" style=\"float:left;font-family:monospace,Verdana !important\">abcXYZ, 세종대왕,1234</p>\n</div>\n\t\t";
Context::addHtmlFooter($fontcheck);
}
if ($addon_info->font1_name) {
$font1 = "@font-face{font-family:{$addon_info->font1_name};font-style:normal;font-weight:normal;src:url('{$addon_info->font1_woff}') format('woff');src:url({$addon_info->font1_eot})\\9}";
if ($addon_info->font1_force == 'Y') {
$font1_force = "body,input,textarea,select,button,table{font-family:{$addon_info->font1_name}}";
}
}
if ($addon_info->font2_name) {
$font2 = "@font-face{font-family:{$addon_info->font2_name};font-style:normal;font-weight:normal;src:url('{$addon_info->font2_woff}') format('woff');src:url({$addon_info->font21_eot})\\9}";
if ($addon_info->font2_force == 'Y') {
$font2_force = "body,input,textarea,select,button,table{font-family:{$addon_info->font2_name}}";
}
}
if ($addon_info->font3_name) {
$font3 = "@font-face{font-family:{$addon_info->font3_name};font-style:normal;font-weight:normal;src:url('{$addon_info->font3_woff}') format('woff');src:url({$addon_info->font3_eot})\\9}";
示例11:
}
if (!$addon_info->show_title) {
$addon_info->show_title = "false";
}
if (!$addon_info->opacity) {
$addon_info->opacity = ".8";
}
if (!$addon_info->theme) {
$addon_info->theme = "pp_default";
}
if (!$addon_info->noWidth) {
$addon_info->noWidth = "100";
}
if (!$addon_info->noHeight) {
$addon_info->noHeight = "100";
}
if (!$addon_info->iframeWidth) {
$addon_info->iframeWidth = "100%";
}
if (!$addon_info->iframeHeight) {
$addon_info->iframeHeight = "100%";
}
if (!$addon_info->linkStyle) {
$addon_info->linkStyle = "pp_i1";
}
if (!$addon_info->linkViewer) {
$addon_info->linkViewer = "1";
}
$prettyphoto = "\n<script type=\"text/javascript\">//<![CDATA[\nvar slideshow0 = {$addon_info->slideshow};\nvar autoplay_slideshow0 = {$addon_info->auto_slide};\nvar opacity0 = {$addon_info->opacity};\nvar show_title0 = {$addon_info->show_title};\nvar theme0 = '{$addon_info->theme}';\nvar noWidth = {$addon_info->noWidth};\nvar noHeight = {$addon_info->noHeight};\nvar iframeWidth = '{$addon_info->iframeWidth}';\nvar iframeHeight = '{$addon_info->iframeHeight}';\nvar linkStyle = '{$addon_info->linkStyle}';\nvar linkMixed = '{$addon_info->linkMixed}';\nvar ifLink = '{$addon_info->ifLink}';\nvar ifLinkViewer = '{$addon_info->linkViewer}';\n//]]></script>\n\t\t";
Context::addHtmlFooter($prettyphoto);
}
示例12:
<?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 */
示例13: dispIssuetrackerViewSource
/**
* @brief 소스 브라우징
**/
function dispIssuetrackerViewSource()
{
// 접근 권한 체크
if (!$this->grant->browser_source || !$this->module_info->svn_url) {
return $this->dispIssuetrackerMessage('msg_not_permitted');
}
require_once $this->module_path . 'classes/svn.class.php';
$path = urldecode(Context::get('path'));
if (!$path) {
$path = '/';
}
Context::set('path', $path);
$revs = Context::get('revs');
$erev = Context::get('erev');
$brev = Context::get('brev');
$oSvn = new Svn($this->module_info->svn_url, $this->module_info->svn_cmd);
$current = $oSvn->getStatus($path);
Context::set('current', $current);
$type = Context::get('type');
switch ($type) {
case 'diff':
case 'compare':
$comp = $oSvn->getComp($path, $brev, $erev);
Context::set('comp', $comp);
$path_tree = Svn::explodePath($path, true);
Context::set('path_tree', $path_tree);
$this->setTemplateFile('source_compare');
break;
case 'log':
if (!$erev) {
$erev = $current->revision;
}
$logs = $oSvn->getLog($path, $erev, $brev, false, 50);
Context::set('logs', $logs);
if (!$erev) {
$erev = $current->erev;
}
context::set('erev', $erev);
context::set('brev', $brev);
$path_tree = Svn::explodePath($path, true);
Context::set('path_tree', $path_tree);
$this->setTemplateFile('source_log');
break;
case 'file':
if ($revs) {
$erev = $revs;
}
if (!$erev) {
$erev = $current->revision;
}
$content = $oSvn->getFileContent($path, $erev);
Context::set('content', $content);
$logs = $oSvn->getLog($path, $erev, $brev, false, 2);
$erev = $logs[0]->revision;
$brev = $logs[1]->revision;
context::set('erev', $erev);
context::set('brev', $brev);
$path_tree = Svn::explodePath($path, true);
Context::set('path_tree', $path_tree);
$file_name = array_pop(array_keys($path_tree));
$file_ext = array_pop(explode(".", $file_name));
$extlist = array("document" => array("doc", "pdf", "hwp"), "image" => array("jpg", "jpeg", "jpe", "gif", "png", "bmp"), "sound" => array("mp3", "ogg", "wma", "wav"), "movie" => array("avi", "mpg", "mpeg", "mpe", "wmv", "asf", "asx", "mov", "flv", "swf"));
foreach ($extlist as $key => $exts) {
foreach ($exts as $s_key => $ext) {
if (!strcasecmp($file_ext, $ext)) {
$file_type = $key;
break 2;
}
}
}
if (!$file_type) {
$file_type = "code";
$extToLang = array("h" => "Cpp", "cpp" => "Cpp", "csharp" => "CSharp", "css" => "Css", "html" => "Xml", "sql" => "Sql", "java" => "Java", "py" => "Python", "rb" => "Ruby", "js" => "JScript", "c" => "Cpp", "vb" => "Vb", "xml" => "Xml", "php" => "Php");
$file_ext_tmp = strtolower($file_ext);
if ($extToLang[$file_ext_tmp]) {
$file_ext = $extToLang[$file_ext_tmp];
}
if (file_exists("./common/js/plugins/code_highlighter/script/shBrush" . $file_ext . ".js")) {
Context::loadJavascriptPlugin("code_highlighter");
Context::addJsFile('./common/js/plugins/code_highlighter/script/shBrush' . $file_ext . '.js', false);
$js_code = <<<dpScript
<script type="text/javascript">
SyntaxHighlighter.config.clipboardSwf = './modules/editor/components/code_highlighter/script/clipboard.swf';
SyntaxHighlighter.all();
</script>
dpScript;
Context::addHtmlFooter($js_code);
Context::set('file_ext', $file_ext_tmp);
}
}
Context::set('file_type', $file_type);
$this->setTemplateFile('source_file_view');
break;
default:
$path_tree = Svn::explodePath($path, false);
Context::set('path_tree', $path_tree);
$list = $oSvn->getList($path, $revs);
//.........这里部分代码省略.........
示例14: doActivateFaceOff
/**
* @brief faceOff관련 서비스 출력을 위한 동작 실행
**/
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
$faceoff_layout_css = $this->getUserLayoutFaceOffCss($layout_info->layout_srl);
if ($faceoff_layout_css) {
Context::addCSSFile($faceoff_layout_css);
}
// 레이아웃의 위젯을 위한 css출력
Context::addCSSFile($this->module_path . '/tpl/css/widget.css');
if ($layout_info->extra_var->colorset->value == 'black') {
Context::addCSSFile($this->module_path . '/tpl/css/widget@black.css');
} else {
Context::addCSSFile($this->module_path . '/tpl/css/widget@white.css');
}
// 권한에 따른 다른 내용 출력
$logged_info = Context::get('logged_info');
// faceOff 레이아웃 편집 버튼 노출
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\"><a href=\"" . getUrl('', 'mid', Context::get('mid'), 'act', 'dispLayoutAdminLayoutModify', 'delete_tmp', 'Y') . "\" class=\"buttonSet buttonLayoutEditor\"><span>" . Context::getLang('cmd_layout_edit') . "</span></a></div>");
}
// faceOff페이지 수정시에 메뉴 출력
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'));
}
}
示例15: procModule
//.........这里部分代码省略.........
$this->error = 'msg_is_not_manager';
$oMessageObject =& ModuleHandler::getModuleInstance('message', 'view');
$oMessageObject->setError(-1);
$oMessageObject->setMessage($this->error);
$oMessageObject->dispMessage();
return $oMessageObject;
}
}
} else {
if ($xml_info->default_index_act && method_exists($oModule, $xml_info->default_index_act)) {
$this->act = $xml_info->default_index_act;
} else {
$this->error = 'msg_invalid_request';
$oModule->setError(-1);
$oModule->setMessage($this->error);
return $oModule;
}
}
}
// ruleset check...
if (!empty($ruleset)) {
$rulesetModule = $forward->module ? $forward->module : $this->module;
$rulesetFile = $oModuleModel->getValidatorFilePath($rulesetModule, $ruleset, $this->mid);
if (!empty($rulesetFile)) {
if ($_SESSION['XE_VALIDATOR_ERROR_LANG']) {
$errorLang = $_SESSION['XE_VALIDATOR_ERROR_LANG'];
foreach ($errorLang as $key => $val) {
Context::setLang($key, $val);
}
unset($_SESSION['XE_VALIDATOR_ERROR_LANG']);
}
$Validator = new Validator($rulesetFile);
$result = $Validator->validate();
if (!$result) {
$lastError = $Validator->getLastError();
$returnUrl = Context::get('error_return_url');
$errorMsg = $lastError['msg'] ? $lastError['msg'] : 'validation error';
//for xml response
$oModule->setError(-1);
$oModule->setMessage($errorMsg);
//for html redirect
$this->error = $errorMsg;
$_SESSION['XE_VALIDATOR_ERROR'] = -1;
$_SESSION['XE_VALIDATOR_MESSAGE'] = $this->error;
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = 'error';
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $returnUrl;
$this->_setInputValueToSession();
return $oModule;
}
}
}
$oModule->setAct($this->act);
$this->module_info->module_type = $type;
$oModule->setModuleInfo($this->module_info, $xml_info);
if ($type == "view" && $this->module_info->use_mobile == "Y" && Mobile::isMobileCheckByAgent()) {
global $lang;
$header = '<style type="text/css">div.xe_mobile{opacity:0.7;margin:1em 0;padding:.5em;background:#333;border:1px solid #666;border-left:0;border-right:0}p.xe_mobile{text-align:center;margin:1em 0}a.xe_mobile{color:#ff0;font-weight:bold;font-size:24px}@media only screen and (min-width:500px){a.xe_mobile{font-size:15px}}</style>';
$footer = '<div class="xe_mobile"><p class="xe_mobile"><a class="xe_mobile" href="' . getUrl('m', '1') . '">' . $lang->msg_pc_to_mobile . '</a></p></div>';
Context::addHtmlHeader($header);
Context::addHtmlFooter($footer);
}
if ($type == "view" && $kind != 'admin') {
$module_config = $oModuleModel->getModuleConfig('module');
if ($module_config->htmlFooter) {
Context::addHtmlFooter($module_config->htmlFooter);
}
}
// if failed message exists in session, set context
$this->_setInputErrorToContext();
$procResult = $oModule->proc();
$methodList = array('XMLRPC' => 1, 'JSON' => 1);
if (!$oModule->stop_proc && !isset($methodList[Context::getRequestMethod()])) {
$error = $oModule->getError();
$message = $oModule->getMessage();
$messageType = $oModule->getMessageType();
$redirectUrl = $oModule->getRedirectUrl();
if (!$procResult) {
$this->error = $message;
if (!$redirectUrl && Context::get('error_return_url')) {
$redirectUrl = Context::get('error_return_url');
}
$this->_setInputValueToSession();
} else {
if (count($_SESSION['INPUT_ERROR'])) {
Context::set('INPUT_ERROR', $_SESSION['INPUT_ERROR']);
$_SESSION['INPUT_ERROR'] = '';
}
}
$_SESSION['XE_VALIDATOR_ERROR'] = $error;
if ($message != 'success') {
$_SESSION['XE_VALIDATOR_MESSAGE'] = $message;
}
$_SESSION['XE_VALIDATOR_MESSAGE_TYPE'] = $messageType;
if (Context::get('xeVirtualRequestMethod') != 'xml') {
$_SESSION['XE_VALIDATOR_RETURN_URL'] = $redirectUrl;
}
}
unset($logged_info);
return $oModule;
}