本文整理汇总了PHP中Context::getLang方法的典型用法代码示例。如果您正苦于以下问题:PHP Context::getLang方法的具体用法?PHP Context::getLang怎么用?PHP Context::getLang使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Context
的用法示例。
在下文中一共展示了Context::getLang方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: procPaypalAdminInsert
/**
* @brief inserts virtual account numbers into the paypal DB table, called by dispPaypalAdminInsert
*/
function procPaypalAdminInsert()
{
$count = 0;
// count for inserting records
$bank = Context::get('bank');
$van_list = explode("\n", Context::get('van_list'));
foreach ($van_list as $van) {
if (!$van) {
continue;
}
// check if $van is empty
$args = new stdClass();
$args->bank = $bank;
$args->van = trim($van);
$output = executeQuery('paypal.insertAccount', $args);
if (!$output->toBool()) {
return $output;
}
$count++;
}
$this->setMessage(sprintf(Context::getLang('msg_regist_count'), $count));
if (!in_array(Context::getRequestMethod(), array('XMLRPC', 'JSON'))) {
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', Context::get('module'), 'act', 'dispPaypalAdminInsert');
$this->setRedirectUrl($returnUrl);
}
}
示例2: procPollAdminDeleteChecked
/**
* @brief 관리자 페이지에서 선택된 설문조사들을 삭제
**/
function procPollAdminDeleteChecked()
{
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if (!$cart) {
return $this->stop('msg_cart_is_null');
}
$poll_srl_list = explode('|@|', $cart);
$poll_count = count($poll_srl_list);
if (!$poll_count) {
return $this->stop('msg_cart_is_null');
}
// 글삭제
for ($i = 0; $i < $poll_count; $i++) {
$poll_index_srl = trim($poll_srl_list[$i]);
if (!$poll_index_srl) {
continue;
}
$output = $this->deletePollTitle($poll_index_srl, true);
if (!$output->toBool()) {
return $output;
}
}
$this->setMessage(sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count));
}
示例3: procEditorCall
/**
* @brief Execute a method of the component when the component requests ajax
**/
function procEditorCall()
{
$component = Context::get('component');
$method = Context::get('method');
if (!$component) {
return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
}
$oEditorModel =& getModel('editor');
$oComponent =& $oEditorModel->getComponentObject($component);
if (!$oComponent->toBool()) {
return $oComponent;
}
if (!method_exists($oComponent, $method)) {
return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
}
//$output = call_user_method($method, $oComponent);
//$output = call_user_func(array($oComponent, $method));
if (method_exists($oComponent, $method)) {
$output = $oComponent->{$method}();
} else {
return new Object(-1, sprintf('%s method is not exists', $method));
}
if ((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) {
return $output;
}
$this->setError($oComponent->getError());
$this->setMessage($oComponent->getMessage());
$vars = $oComponent->getVariables();
if (count($vars)) {
foreach ($vars as $key => $val) {
$this->add($key, $val);
}
}
}
示例4: getBoardAdminSimpleSetup
/**
* Get the board module admin simple setting page
* @return void
*/
public function getBoardAdminSimpleSetup($moduleSrl, $setupUrl)
{
if (!$moduleSrl) {
return;
}
Context::set('module_srl', $moduleSrl);
// default module info setting
$oModuleModel = getModel('module');
$moduleInfo = $oModuleModel->getModuleInfoByModuleSrl($moduleSrl);
$moduleInfo->use_status = explode('|@|', $moduleInfo->use_status);
if ($moduleInfo) {
Context::set('module_info', $moduleInfo);
}
// get document status list
$oDocumentModel = getModel('document');
$documentStatusList = $oDocumentModel->getStatusNameList();
Context::set('document_status_list', $documentStatusList);
// set order target list
foreach ($this->order_target as $key) {
$order_target[$key] = Context::getLang($key);
}
$order_target['list_order'] = Context::getLang('document_srl');
$order_target['update_order'] = Context::getLang('last_update');
Context::set('order_target', $order_target);
// for advanced language & url
$oAdmin = getClass('admin');
Context::set('setupUrl', $setupUrl);
// Extract admin ID set in the current module
$admin_member = $oModuleModel->getAdminId($moduleSrl);
Context::set('admin_member', $admin_member);
$oTemplate =& TemplateHandler::getInstance();
$html = $oTemplate->compile($this->module_path . 'tpl/', 'board_setup_basic');
return $html;
}
示例5: dispEditorPopup
/**
* @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');
}
}
示例6: dispEditorPopup
/**
* @brief Action to get a request to display compoenet pop-up
*/
function dispEditorPopup()
{
// add a css file
Context::loadFile($this->module_path . "tpl/css/editor.css", true);
// List variables
$editor_sequence = Context::get('editor_sequence');
$component = Context::get('component');
$site_module_info = Context::get('site_module_info');
$site_srl = (int) $site_module_info->site_srl;
// Get compoenet object
$oEditorModel = getModel('editor');
$oComponent =& $oEditorModel->getComponentObject($component, $editor_sequence, $site_srl);
if (!$oComponent->toBool()) {
Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('component_not_founded');
} else {
// Get the result after executing a method to display popup url of the component
$popup_content = $oComponent->getPopupContent();
Context::set('popup_content', $popup_content);
// Set layout to popup_layout
$this->setLayoutFile('popup_layout');
// Set a template
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('popup');
}
}
示例7: printBtn
/**
* @brief Button to output
**/
function printBtn()
{
if ($this->nextUrl) {
$url = $this->nextUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
if ($this->prevUrl) {
$url = $this->prevUrl;
printf('<a href="%s">%s</a><br>%s', $url->url, $url->text, "\n");
}
// Select Language
if (!parent::isLangChange()) {
$url = getUrl('', 'lcm', '1', 'sel_lang', Context::getLangType(), 'return_uri', Context::get('current_url'));
printf('<a href="%s">%s</a><br>%s', $url, 'Language : ' . Context::getLang('select_lang'), "\n");
} else {
printf('<a href="%s">%s</a><br>%s', Context::get('return_uri'), Context::getLang('lang_return'), "\n");
}
if ($this->upperUrl) {
$url = $this->upperUrl;
printf('<btn href="%s" name="%s">%s', $url->url, $url->text, "\n");
}
if ($this->homeUrl) {
$url = $this->homeUrl;
printf('<a btn="%s" href="%s">%s</a><br>%s', $url->text, $url->url, $url->text, "\n");
}
}
示例8: procTrackbackAdminDeleteChecked
/**
* Trackbacks delete selected in admin page
* @return void|Object
*/
function procTrackbackAdminDeleteChecked()
{
// An error appears if no document is selected
$cart = Context::get('cart');
if (!is_array($cart)) {
$trackback_srl_list = explode('|@|', $cart);
} else {
$trackback_srl_list = $cart;
}
$trackback_count = count($trackback_srl_list);
if (!$trackback_count) {
return $this->stop('msg_cart_is_null');
}
$oTrackbackController =& getController('trackback');
// Delete the post
for ($i = 0; $i < $trackback_count; $i++) {
$trackback_srl = trim($trackback_srl_list[$i]);
if (!$trackback_srl) {
continue;
}
$oTrackbackController->deleteTrackback($trackback_srl, true);
}
$this->setMessage(sprintf(Context::getLang('msg_checked_trackback_is_deleted'), $trackback_count));
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispTrackbackAdminList');
$this->setRedirectUrl($returnUrl);
}
示例9: procPollAdminDeleteChecked
/**
* @brief Delete the polls selected in the administrator's page
**/
function procPollAdminDeleteChecked()
{
// Display an error no post is selected
$cart = Context::get('cart');
if (is_array($cart)) {
$poll_srl_list = $cart;
} else {
$poll_srl_list = explode('|@|', $cart);
}
$poll_count = count($poll_srl_list);
if (!$poll_count) {
return $this->stop('msg_cart_is_null');
}
// Delete the post
for ($i = 0; $i < $poll_count; $i++) {
$poll_index_srl = trim($poll_srl_list[$i]);
if (!$poll_index_srl) {
continue;
}
$output = $this->deletePollTitle($poll_index_srl, true);
if (!$output->toBool()) {
return $output;
}
}
$this->setMessage(sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count));
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList');
$this->setRedirectUrl($returnUrl);
}
示例10: triggerGetManagerMenu
function triggerGetManagerMenu(&$manager_menu)
{
$oModuleModel = getModel('module');
$logged_info = Context::get('logged_info');
$output = executeQueryArray('cympusadmin.getModInstList');
if (!$output->toBool()) {
return $output;
}
$list = $output->data;
$menu = new stdClass();
$menu->title = Context::getLang('site_management');
$menu->icon = 'dashboard';
$menu->module = 'cympusadmin';
$menu->submenu = array();
foreach ($list as $key => $val) {
$grant = $oModuleModel->getGrant($val, $logged_info);
if ($grant->manager) {
$submenu = new stdClass();
$submenu->action = array('dispCympusadminAdminIndex');
$submenu->mid = $val->mid;
$submenu->title = Context::getLang('site_status');
$submenu->module = 'cympusadmin';
$menu->submenu[] = $submenu;
}
}
if (count($menu->submenu)) {
$manager_menu['cympusadmin'] = $menu;
}
}
示例11: proc
/**
* @brief 위젯의 실행 부분
*
* ./widgets/위젯/conf/info.xml 에 선언한 extra_vars를 args로 받는다
* 결과를 만든후 print가 아니라 return 해주어야 한다
**/
function proc($args)
{
// 위젯 자체적으로 설정한 변수들을 체크
$title = $args->title;
$PAGE_LIMIT = $args->page_limit ? $args->page_limit : 10;
// 날짜 형태
$DATE_FORMAT = $args->date_format ? $args->date_format : "Y-m-d H:i:s";
$buff = $this->rss_request($args->rss_url);
if (!is_string($buff) or !$buff) {
return Context::getLang('msg_fail_to_request_open');
}
$encoding = preg_match("/<\\?xml.*encoding=\"(.+)\".*\\?>/i", $buff, $matches);
if ($encoding && !preg_match("/UTF-8/i", $matches[1])) {
$buff = trim(iconv($matches[1] == "ks_c_5601-1987" ? "EUC-KR" : $matches[1], "UTF-8", $buff));
}
$buff = preg_replace("/<\\?xml.*\\?>/i", "", $buff);
$oXmlParser = new XmlParser();
$xml_doc = $oXmlParser->parse($buff);
$rss->title = $xml_doc->rss->channel->title->body;
$rss->link = $xml_doc->rss->channel->link->body;
$items = $xml_doc->rss->channel->item;
if (!$items) {
return Context::getLang('msg_invalid_format');
}
if ($items && !is_array($items)) {
$items = array($items);
}
$rss_list = array();
foreach ($items as $key => $value) {
if ($key >= $PAGE_LIMIT) {
break;
}
unset($item);
foreach ($value as $key2 => $value2) {
if (is_array($value2)) {
$value2 = array_shift($value2);
}
$item->{$key2} = $value2->body;
}
$date = $item->pubdate;
$item->date = $date ? date($DATE_FORMAT, strtotime($date)) : '';
$array_date[$key] = strtotime($date);
$item->description = preg_replace('!<a href=!is', '<a onclick="window.open(this.href);return false" href=', $item->description);
$rss_list[$key] = $item;
}
array_multisort($array_date, SORT_DESC, $rss_list);
$widget_info->rss = $rss;
$widget_info->rss_list = $rss_list;
$widget_info->title = $title;
$widget_info->rss_height = $args->rss_height ? $args->rss_height : 200;
$widget_info->subject_cut_size = $args->subject_cut_size;
Context::set('widget_info', $widget_info);
// 템플릿의 스킨 경로를 지정 (skin, colorset에 따른 값을 설정)
$tpl_path = sprintf('%sskins/%s', $this->widget_path, $args->skin);
Context::set('colorset', $args->colorset);
// 템플릿 컴파일
$oTemplate =& TemplateHandler::getInstance();
$output = $oTemplate->compile($tpl_path, 'list');
return $output;
}
示例12: dispDocumentAdminList
/**
* @brief 목록 출력 (관리자용)
**/
function dispDocumentAdminList()
{
// 목록을 구하기 위한 옵션
$args->page = Context::get('page');
///< 페이지
$args->list_count = 30;
///< 한페이지에 보여줄 글 수
$args->page_count = 10;
///< 페이지 네비게이션에 나타날 페이지의 수
$args->search_target = Context::get('search_target');
///< 검색 대상 (title, contents...)
$args->search_keyword = Context::get('search_keyword');
///< 검색어
$args->sort_index = 'list_order';
///< 소팅 값
$args->module_srl = Context::get('module_srl');
// 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조이다... (아.. 이거 나쁜 버릇인데.. ㅡ.ㅜ 어쩔수 없다)
$oDocumentModel =& getModel('document');
$output = $oDocumentModel->getDocumentList($args);
// 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('document_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
// 템플릿에서 사용할 검색옵션 세팅
$count_search_option = count($this->search_option);
for ($i = 0; $i < $count_search_option; $i++) {
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
}
Context::set('search_option', $search_option);
// 템플릿 지정
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('document_list');
}
示例13: procCommentAdminDeleteChecked
/**
* @brief 관리자 페이지에서 선택된 댓글들을 삭제
**/
function procCommentAdminDeleteChecked()
{
// 선택된 글이 없으면 오류 표시
$cart = Context::get('cart');
if (!$cart) {
return $this->stop('msg_cart_is_null');
}
$comment_srl_list = explode('|@|', $cart);
$comment_count = count($comment_srl_list);
if (!$comment_count) {
return $this->stop('msg_cart_is_null');
}
$oCommentController =& getController('comment');
$deleted_count = 0;
// 글삭제
for ($i = 0; $i < $comment_count; $i++) {
$comment_srl = trim($comment_srl_list[$i]);
if (!$comment_srl) {
continue;
}
$output = $oCommentController->deleteComment($comment_srl, true);
if (!$output->toBool()) {
continue;
}
$deleted_count++;
}
$this->setMessage(sprintf(Context::getLang('msg_checked_comment_is_deleted'), $deleted_count));
}
示例14: dispDocumentAdminList
/**
* Display a list(administrative)
* @return void
*/
function dispDocumentAdminList()
{
// option to get a list
$args = new stdClass();
$args->page = Context::get('page');
// /< Page
$args->list_count = 30;
// /< the number of posts to display on a single page
$args->page_count = 5;
// /< the number of pages that appear in the page navigation
$args->search_target = Context::get('search_target');
// /< search (title, contents ...)
$args->search_keyword = Context::get('search_keyword');
// /< keyword to search
$args->sort_index = 'list_order';
// /< sorting value
$args->module_srl = Context::get('module_srl');
// get a list
$oDocumentModel = getModel('document');
$columnList = array('document_srl', 'module_srl', 'title', 'member_srl', 'nick_name', 'readed_count', 'voted_count', 'blamed_count', 'regdate', 'ipaddress', 'status');
$output = $oDocumentModel->getDocumentList($args, false, true, $columnList);
// get Status name list
$statusNameList = $oDocumentModel->getStatusNameList();
// Set values of document_model::getDocumentList() objects for a template
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('document_list', $output->data);
Context::set('status_name_list', $statusNameList);
Context::set('page_navigation', $output->page_navigation);
// set a search option used in the template
$count_search_option = count($this->search_option);
for ($i = 0; $i < $count_search_option; $i++) {
$search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]);
}
Context::set('search_option', $search_option);
$oModuleModel = getModel('module');
$module_list = array();
$mod_srls = array();
foreach ($output->data as $oDocument) {
$mod_srls[] = $oDocument->get('module_srl');
}
$mod_srls = array_unique($mod_srls);
// Module List
$mod_srls_count = count($mod_srls);
if ($mod_srls_count) {
$columnList = array('module_srl', 'mid', 'browser_title');
$module_output = $oModuleModel->getModulesInfo($mod_srls, $columnList);
if ($module_output && is_array($module_output)) {
foreach ($module_output as $module) {
$module_list[$module->module_srl] = $module;
}
}
}
Context::set('module_list', $module_list);
// Specify a template
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile('document_list');
}
示例15: procRssAdminInsertConfig
/**
* @brief RSS 전체피드 설정
**/
function procRssAdminInsertConfig()
{
$oModuleModel =& getModel('module');
$total_config = $oModuleModel->getModuleConfig('rss');
$config_vars = Context::getRequestVars();
$config_vars->feed_document_count = (int) $config_vars->feed_document_count;
if (!$config_vars->use_total_feed) {
$alt_message = 'msg_invalid_request';
}
if (!in_array($config_vars->use_total_feed, array('Y', 'N'))) {
$config_vars->open_rss = 'Y';
}
if ($config_vars->image || $config_vars->del_image) {
$image_obj = $config_vars->image;
$config_vars->image = $total_config->image;
// 삭제 요청에 대한 변수를 구함
if ($config_vars->del_image == 'Y' || $image_obj) {
FileHandler::removeFile($config_vars->image);
$config_vars->image = '';
$total_config->image = '';
}
// 정상적으로 업로드된 파일이 아니면 무시
if ($image_obj['tmp_name'] && is_uploaded_file($image_obj['tmp_name'])) {
// 이미지 파일이 아니어도 무시 (swf는 패스~)
$image_obj['name'] = Context::convertEncodingStr($image_obj['name']);
if (!preg_match("/\\.(jpg|jpeg|gif|png)\$/i", $image_obj['name'])) {
$alt_message = 'msg_rss_invalid_image_format';
} else {
// 경로를 정해서 업로드
$path = './files/attach/images/rss/';
// 디렉토리 생성
if (!FileHandler::makeDir($path)) {
$alt_message = 'msg_error_occured';
} else {
$filename = $path . $image_obj['name'];
// 파일 이동
if (!move_uploaded_file($image_obj['tmp_name'], $filename)) {
$alt_message = 'msg_error_occured';
} else {
$config_vars->image = $filename;
}
}
}
}
}
if (!$config_vars->image && $config_vars->del_image != 'Y') {
$config_vars->image = $total_config->image;
}
$output = $this->setFeedConfig($config_vars);
if (!$alt_message) {
$alt_message = 'success_updated';
}
$alt_message = Context::getLang($alt_message);
Context::set('msg', $alt_message);
$this->setLayoutPath('./common/tpl');
$this->setLayoutFile('default_layout.html');
$this->setTemplatePath($this->module_path . 'tpl');
$this->setTemplateFile("top_refresh.html");
}