Example #1
0
 /**
  * @brief 컴포넌트의 팝업 출력을 요청을 받는 action
  **/
 function dispEditorPopup()
 {
     // css 파일 추가
     Context::addCssFile($this->module_path . "tpl/css/editor.css");
     // 변수 정리
     $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;
     // component 객체를 받음
     $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 {
         // 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음
         $popup_content = $oComponent->getPopupContent();
         Context::set('popup_content', $popup_content);
         // 레이아웃을 popup_layout으로 설정
         $this->setLayoutFile('popup_layout');
         // 템플릿 지정
         $this->setTemplatePath($this->module_path . 'tpl');
         $this->setTemplateFile('popup');
     }
 }
Example #2
0
 /**
  * @brief 목록 출력 (관리자용)
  **/
 function dispSpringnoteContent()
 {
     // 권한 체크
     if (!$this->grant->access) {
         return $this->dispSpringnoteMessage('msg_not_permitted');
     }
     $pageid = (int) Context::get('pageid');
     if ($this->module_info->pageid && $this->module_info->pageid_option != 'list') {
         $pageid = $this->module_info->pageid;
     }
     if (!$pageid && $this->module_info->pageid) {
         $pageid = $this->module_info->pageid;
     }
     $q = Context::get('q');
     $oSpringnoteModel =& getModel('springnote');
     $oSpringnoteModel->setInfo($this->module_info->openid, $this->module_info->userkey, $this->module_info->domain);
     // 특정 페이지 선택시 페이지 정보 가져오기
     if ($this->grant->view && $pageid) {
         $page = $oSpringnoteModel->getPage($pageid);
         if ($page) {
             for ($i = 0; $i < count($page->css_files); $i++) {
                 $css_file = $page->css_files[$i];
                 Context::addCssFile($css_file);
             }
             Context::addBrowserTitle($page->title);
         }
     }
     // 페이지 목록 가져오기
     if ($this->module_info->pageid && $this->module_info->pageid_option != 'list') {
         $pages = null;
     } else {
         if ($this->module_info->pageid && $this->module_info->pageid_option == 'list') {
             $pages = $oSpringnoteModel->getPages($q, true, $this->module_info->pageid);
         } else {
             $pages = $oSpringnoteModel->getPages($q, true);
         }
     }
     if ($pageid) {
         if ($pages[$pageid]->prev) {
             $page->prev = $pages[$pageid]->prev;
         }
         if ($pages[$pageid]->next) {
             $page->next = $pages[$pageid]->next;
         }
     }
     Context::set('page', $page);
     Context::set('pages', $pages);
     $this->setTemplateFile('list');
 }
 /**
  * @brief textyle init service
  **/
 function initService(&$oModule, $is_other_module = false, $isMobile = false)
 {
     if (!$oModule) {
         $oModule = $this;
     }
     $oTextyleModel =& getModel('textyle');
     $this->initCommon($is_other_module);
     Context::addJsFile($this->module_path . 'tpl/js/textyle_service.js');
     $preview_skin = Context::get('preview_skin');
     if (!$isMobile) {
         if ($is_other_module) {
             $path_method = 'setLayoutPath';
             $file_method = 'setLayoutFile';
             $css_path_method = 'getLayoutPath';
             Context::set('textyle_mode', 'module');
         } else {
             $path_method = 'setTemplatePath';
             $file_method = 'setTemplateFile';
             $css_path_method = 'getTemplatePath';
         }
         if (!$preview_skin) {
             $oTextyleModel->checkTextylePath($this->module_srl, $this->module_info->skin);
             $oModule->{$path_method}($oTextyleModel->getTextylePath($this->module_srl));
         } else {
             $oModule->{$path_method}($this->module_path . 'skins/' . $preview_skin);
         }
         $oModule->{$file_method}('textyle');
         Context::addCssFile($oModule->{$css_path_method}() . 'textyle.css', true, 'all', '', 100);
     }
     Context::set('root_url', Context::getRequestUri());
     Context::set('home_url', getFullSiteUrl($this->textyle->domain));
     Context::set('profile_url', getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleProfile'));
     Context::set('guestbook_url', getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleGuestbook'));
     Context::set('tag_url', getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleTag'));
     if (Context::get('is_logged')) {
         Context::set('admin_url', getSiteUrl($this->textyle->domain, '', 'mid', $this->module_info->mid, 'act', 'dispTextyleToolDashboard'));
     } else {
         Context::set('admin_url', getSiteUrl($textyle->domain, '', 'mid', 'textyle', 'act', 'dispTextyleToolLogin'));
     }
     Context::set('textyle_title', $this->textyle->get('textyle_title'));
     if ($this->textyle->get('post_use_prefix') == 'Y' && $this->textyle->get('post_prefix')) {
         Context::set('post_prefix', $this->textyle->get('post_prefix'));
     }
     if ($this->textyle->get('post_use_suffix') == 'Y' && $this->textyle->get('post_suffix')) {
         Context::set('post_suffix', $this->textyle->get('post_suffix'));
     }
     $extra_menus = array();
     $args->site_srl = $this->site_srl;
     $output = executeQueryArray('textyle.getExtraMenus', $args);
     if ($output->toBool() && $output->data) {
         foreach ($output->data as $i => $menu) {
             $extra_menus[$menu->name] = getUrl('', 'mid', $menu->mid);
         }
     }
     Context::set('extra_menus', $extra_menus);
     // set browser title
     Context::setBrowserTitle($this->textyle->get('browser_title'));
 }
/*
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']);
                    $new_document_notify = "<script type='text/javascript'>\n\t\t\t\t\t\t\t\t\t\t\tsocket.emit('sendToServer', {title :'" . $title . "' , document_srl : '" . $srl . "'});\n\t\t\t\t\t\t\t\t\t\t\t</script>";
<?php

if (!defined("__ZBXE__")) {
    exit;
}
if ($called_position != "before_display_content") {
    return;
}
// applying to only board module
$oBoardView =& getView('board');
if (Context::getResponseMethod() == "XMLRPC" || Context::getRequestMethod() == 'XMLRPC' || $oBoardView->act != 'dispBoardContent') {
    return;
}
if (!$addon_info->display) {
    Context::addCssFile('./addons/exif/css/exif.css');
}
if ($addon_info->display == '2') {
    Context::addCssFile('./addons/exif/css/exif2.css');
}
if ($addon_info->display == '3') {
    Context::addCssFile('./addons/exif/css/exif3.css');
} else {
    Context::addJsFile('./addons/exif/js/exif.js', false, '', null, 'body');
}
require_once "exif.lib.php";
// call getImageExif() with retrieved image path
$pattern_image_tag = "/<img(.*?)(src=\"[^ ]*)(files\\/attach\\/images\\/[^\"]+)+([^>]*?)(>)+/i";
$pattern_documents_area = '/<!--BeforeDocument\\([0-9]+,[0-9]+\\)-->.+<!--AfterDocument\\([0-9]+,[0-9]+\\)-->/is';
$output = preg_replace_callback($pattern_documents_area, create_function('$matches', "return preg_replace_callback('{$pattern_image_tag}', 'getExifData', \$matches[0]);"), $output);
 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 . ';" ');
     }
 }
<?php

if (!defined("__ZBXE__")) {
    exit;
}
if ($called_position == 'after_module_proc' && Context::getResponseMethod() == "HTML" && !Mobile::isMobileCheckByAgent()) {
    Context::addCssFile('./addons/prettyphoto/css/prettyPhoto.css');
    Context::addCssFile('./addons/prettyphoto/css/addon.css');
    Context::addJsFile('./addons/prettyphoto/js/jquery.prettyPhoto.js', false, '', null, 'body');
    Context::addJsFile('./addons/prettyphoto/js/addon.js', false, '', null, 'body');
    Context::loadLang('./addons/prettyphoto/lang');
    if (!$addon_info->slideshow) {
        $addon_info->slideshow = "5000";
    }
    if (!$addon_info->auto_slide) {
        $addon_info->auto_slide = "false";
    }
    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";
                 }
             } else {
                 Context::addCssFile('./addons/webfont/css/nanumfont.css');
             }
         }
         if (!$addon_info->ng) {
             $ng = "@font-face{font-family:ng;font-style:normal;font-weight:normal;src:url(http://themes.googleusercontent.com/static/fonts/earlyaccess/nanumgothic/v3/NanumGothic-Regular.eot)\\9}\n@font-face{font-family:ng;font-style:normal;font-weight:bold;src:url(http://themes.googleusercontent.com/static/fonts/earlyaccess/nanumgothic/v3/NanumGothic-Bold.eot)\\9}";
         }
         if ($addon_info->nm == 'Y') {
             $nm = "@font-face{font-family:nm;font-style:normal;font-weight:normal;src:url(http://themes.googleusercontent.com/static/fonts/earlyaccess/nanummyeongjo/v2/NanumMyeongjo-Regular.eot)\\9}\n@font-face{font-family:nm;font-style:normal;font-weight:bold;src:url(themes.googleusercontent.com/static/fonts/earlyaccess/nanummyeongjo/v2/NanumMyeongjo-Bold.eot)\\9}";
         }
         if ($addon_info->np == 'Y') {
             $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}";
Example #9
0
<?php

if (!defined("__ZBXE__")) {
    exit;
}
if ($called_position == 'after_module_proc' && Context::getResponseMethod() != "XMLRPC" && Context::get('act') == 'dispWikiEditPage') {
    $module_info = Context::get('module_info');
    if (!$module_info->module) {
        return;
    }
    if ($module_info->module != 'wiki') {
        return;
    }
    Context::loadJavascriptPlugin('hotkeys');
    Context::addJsFile('./addons/wiki_link/wikilink.js', false);
    Context::addCssFile('./addons/wiki_link/wikilink.css', false);
}
Example #10
0
	/**
	 * shop init service
	 **/
	public function initService(&$oModule, $is_other_module = FALSE, $isMobile = FALSE){
		if (!$oModule) $oModule = $this;

        /** @var $oShopModel shopModel */
		$oShopModel = getModel('shop');

		$this->initCommon($is_other_module);

		Context::addJsFile($this->module_path.'tpl/js/shop_service.js');

		$preview_skin = Context::get('preview_skin');
		if(!$isMobile)
		{
			if($is_other_module){
				$path_method = 'setLayoutPath';
				$file_method = 'setLayoutFile';
				$css_path_method = 'getLayoutPath';
				Context::set('shop_mode', 'module');
				Context::set('external_module', $oModule->module);
			}else{
				$path_method = 'setTemplatePath';
				$file_method = 'setTemplateFile';
				$css_path_method = 'getTemplatePath';
			}

			if(!$preview_skin){
				$oShopModel->checkShopPath($this->module_srl, $this->module_info->skin);
				$oModule->{$path_method}($oShopModel->getShopPath($this->module_srl));
			}else{
				$oModule->{$path_method}($this->module_path.'skins/'.$preview_skin);
			}

			$oModule->{$file_method}('shop');
			Context::addCssFile($oModule->{$css_path_method}().'shop.css',TRUE,'all','',100);
		}

		Context::set('root_url', Context::getRequestUri());
		Context::set('home_url', getFullSiteUrl($this->shop->domain));
		Context::set('profile_url', getSiteUrl($this->shop->domain,'','mid',$this->module_info->mid,'act','dispShopProfile'));
		if(Context::get('is_logged')) Context::set('admin_url', getSiteUrl($this->shop->domain,'','mid',$this->module_info->mid,'act','dispShopToolDashboard'));
		else Context::set('admin_url', getSiteUrl($this->shop->domain,'','mid','shop','act','dispShopToolLogin'));
		Context::set('shop_title', $this->shop->get('shop_title'));

		// set browser title
		Context::setBrowserTitle($this->shop->get('browser_title'));

        // Load cart for display on all pages (in header)
        $cartRepo = new CartRepository();
        $logged_info = Context::get('logged_info');
		// If cart doesn't exist, create new one
        $cart = $cartRepo->getCart($this->module_srl, NULL, $logged_info->member_srl, session_id(), TRUE);
        Context::set('cart', $cart);

        // Load cart preview (for ajax cart feature in header)
		$cart_preview = new CartPreview($cart, 3);
		Context::set('cart_preview', $cart_preview);

        // Load menu for display on all pages (in header)
        $shop = Context::get('shop');
        $menus = $shop->getMenus();
        foreach($menus as $menu_key => $menu_srl)
        {
            $menu = new ShopMenu($menu_srl);
            Context::set($menu_key, $menu->getHtml());
        }

        // Load categories for display in search dropdown (header)
        $category_repository = new CategoryRepository();
        $tree = $category_repository->getNavigationCategoriesTree($this->module_srl);
        $flat_tree = $tree->toFlatStructure();
        Context::set('search_categories', $flat_tree);
	}
    unset($matches);
    preg_match_all($pattern, $output, $matches);
    $comment_srls = $matches[1];
    // 문서
    $pattern = "/<!--BeforeDocument\\((.*),.*\\)-->/U";
    unset($matches);
    preg_match_all($pattern, $output, $matches);
    $document_srls = $matches[1];
    // 문서 번호와 댓글 번호를 합친다.
    $srls = array_merge($comment_srls, $document_srls);
    // 해당 소셜 정보를 가져온다.
    $args->srls = $srls;
    $res = executeQueryArray('addons.socialxe_helper.getSocialxes', $args);
    if ($res->data) {
        // CSS 파일 불러오기
        Context::addCssFile('./addons/socialxe_helper/css/css.css');
        // 소셜 정보를 가공
        foreach ($res->data as $val) {
            $GLOBALS['social_info'][$val->comment_srl]->provider = $val->provider;
            $GLOBALS['social_info'][$val->comment_srl]->id = $val->id;
            $GLOBALS['social_info'][$val->comment_srl]->social_nick_name = $val->social_nick_name;
        }
        // 댓글의 소셜 정보 출력
        $pattern = "/<!--BeforeComment\\((.*),.*\\)-->/U";
        $output = preg_replace_callback($pattern, create_function('$matches', '$social_info = $GLOBALS["social_info"][$matches[1]];' . 'if (!$social_info->provider || $social_info->provider == "xe") return $matches[0];' . '$oSocialxeModel = &getModel("socialxe");' . '$link = $oSocialxeModel->getAuthorLink($social_info->provider, $social_info->id, $social_info->social_nick_name);' . '$lang_provider = Context::getLang("provider");' . 'return \'<div class="socialxe_helper_info" style="text-align: right;"><a href="\' . $link . \'" target="_blank" class="socialxe_helper \' . $social_info->provider . \'" title="\' . Context::getLang("prefix_social_info") . $lang_provider[$social_info->provider] . \'">\' . $lang_provider[$social_info->provider] . \'</a></div>\' . $matches[0];'), $output);
        // 문서의 소셜 정보 출력
        $pattern = "/<!--BeforeDocument\\((.*),.*\\)-->/U";
        $output = preg_replace_callback($pattern, create_function('$matches', '$social_info = $GLOBALS["social_info"][$matches[1]];' . 'if (!$social_info->provider || $social_info->provider == "xe") return $matches[0];' . '$oSocialxeModel = &getModel("socialxe");' . '$link = $oSocialxeModel->getAuthorLink($social_info->provider, $social_info->id, $social_info->social_nick_name);' . '$lang_provider = Context::getLang("provider");' . 'return \'<div class="socialxe_helper_info" style="text-align: right;"><a href="\' . $link . \'" target="_blank" class="socialxe_helper \' . $social_info->provider . \'" title="\' . Context::getLang("prefix_social_info") . $lang_provider[$social_info->provider] . \'">\' . $lang_provider[$social_info->provider] . \'</a></div>\' . $matches[0];'), $output);
    }
}
// 텍스타일의 발행 화면에 SocialXE Info 위젯 표시