From 4eac255d7df9cf77eaca194e6373cba906df32e2 Mon Sep 17 00:00:00 2001 From: flyskyko Date: Thu, 11 Oct 2012 03:08:17 +0000 Subject: [PATCH] Issue 2380: Admin UI Refactoring - Advanced - Layouts git-svn-id: http://xe-core.googlecode.com/svn/branches/maserati@11661 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- common/js/common.js | 11 - modules/admin/tpl/js/admin.js | 362 ++++++- modules/admin/tpl/js/admin.min.js | 955 +----------------- modules/layout/tpl/layout_modify.html | 11 +- modules/module/conf/module.xml | 2 + modules/module/lang/lang.xml | 26 + modules/module/module.admin.model.php | 40 + .../module/queries/getLangListByLangcode.xml | 1 + modules/module/tpl/multilingual_v17.html | 48 + modules/module/tpl/multilingual_v17_list.html | 64 ++ 10 files changed, 584 insertions(+), 936 deletions(-) create mode 100644 modules/module/tpl/multilingual_v17.html create mode 100644 modules/module/tpl/multilingual_v17_list.html diff --git a/common/js/common.js b/common/js/common.js index bb8128aae..5aa313bfd 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -924,17 +924,6 @@ function get_by_id(id) { } jQuery(function($){ - $('.lang_code').each( - function() - { - var objText = $(this); - var targetName = objText.attr("id"); - if(typeof(targetName) == "undefined") targetName = objText.attr("name"); - if(typeof(targetName) == "undefined") return; - objText.after("find_langcode"); - } - ); - // display popup menu that contains member actions and document actions $(document).click(function(evt) { var $area = $('#popup_menu_area'); diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 1920b6439..2755f1fb4 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1,7 +1,7 @@ /* NHN (developers@xpressengine.com) */ jQuery(function($){ // iSO mobile device toolbar remove - window.top.scrollTo(0,0); + window.scrollTo(0,0); // Skip to content $('.x .skipNav>a').click(function(){ $($(this).attr('href')).attr('tabindex','0').css('outline','0').focus(); @@ -34,7 +34,7 @@ jQuery(function($){ }); // Tab Navigation $('.x .x_tab-content>.x_tab-pane:not(".x_active")').hide(); - $('.x .x_nav-tabs').find('>li>a[href^="#"]').click(function(){ + $(document.body).on('click', '.x .x_nav-tabs>li>a[href^="#"]', function(){ var $this = $(this); $this.parent('li').addClass('x_active').siblings().removeClass('x_active'); $this.closest('.x_nav-tabs').next('.x_tab-content').find($this.attr('href')).addClass('x_active').show().siblings().removeClass('x_active').hide(); @@ -234,9 +234,9 @@ $.fn.xeModalWindow = function(){ $('.x_modal-backdrop').hide(); $this.focus(); }); + $('div.x_modal').addClass('x').hide(); }; $('a.modalAnchor').xeModalWindow(); -$('div.x_modal').addClass('x').hide(); }); @@ -896,6 +896,362 @@ $('.filebox') simpleBtn.removeClass('x_active'); }); +// Multilingual + var $multilinguals_v15 = $('.vLang[type="hidden"]'); + var $multilinguals = $('.lang_code'); + + if($multilinguals_v15.length || $multilinguals.length){ + function on_complete(data){ + var $content = $('.x #content'); + $content.append(data.html); + + var tmpCount = 0; + + $multilinguals_v15.each(function(){ + var $this = $(this); + + $this.removeClass('vLang').addClass('lang_code'); + $this.parent().find('.editUserLang').remove(); + }); + + $multilinguals = $('.lang_code'); + + $multilinguals.each(function(){ + var $this = $(this); + var id = $this.attr('id'); + if(!id){ + id = '__lang_code_' + tmpCount; + tmpCount++; + $this.attr('id', id); + } + + if(this.tagName == 'TEXTAREA' || $this.next('textarea.vLang').length){ + var $displayInput = $(' - {$lang->cmd_set_multilingual} + @@ -95,7 +90,7 @@

- +

diff --git a/modules/module/conf/module.xml b/modules/module/conf/module.xml index 30d9ea662..ffe5fada4 100644 --- a/modules/module/conf/module.xml +++ b/modules/module/conf/module.xml @@ -36,6 +36,8 @@ + + diff --git a/modules/module/lang/lang.xml b/modules/module/lang/lang.xml index 7e1dc2382..e08b52981 100644 --- a/modules/module/lang/lang.xml +++ b/modules/module/lang/lang.xml @@ -1057,4 +1057,30 @@ Le module [Administration des Modules] montera tous les modules installés et vo + + + + + + + + + + + 다국어]]> + Mualtilungal]]> + + + + %d개의 다국어 세트가 있습니다.]]> + %d multilingual sets.]]> + + + + + + + + + diff --git a/modules/module/module.admin.model.php b/modules/module/module.admin.model.php index dc3d42c66..3de2e5b20 100644 --- a/modules/module/module.admin.model.php +++ b/modules/module/module.admin.model.php @@ -421,5 +421,45 @@ return $output; } + /** + * return multilingual html + */ + function getModuleAdminMultilingualHtml() + { + $oTemplate = TemplateHandler::getInstance(); + $tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17.html'); + + $this->add('html', $tpl); + } + + /** + * return multilingual list html + */ + function getModuleAdminLangListHtml() + { + $siteModuleInfo = Context::get('site_module_info'); + $args->site_srl = (int)$site_module_info->site_srl; + $args->langCode = Context::get('lang_type'); + $args->page = Context::get('page'); + $args->sort_index = 'name'; + $args->order_type = 'asc'; + $args->search_keyword = Context::get('search_keyword'); + $args->name = Context::get('name'); + $args->list_count = 5; + $args->page_count = 5; + + $output = $this->getLangListByLangcode($args); + + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('lang_code_list', $output->data); + Context::set('page_navigation', $output->page_navigation); + + $oTemplate = TemplateHandler::getInstance(); + $tpl = $oTemplate->compile('./modules/module/tpl', 'multilingual_v17_list.html'); + + $this->add('html', $tpl); + } } ?> diff --git a/modules/module/queries/getLangListByLangcode.xml b/modules/module/queries/getLangListByLangcode.xml index fe0e12e91..a0b7c8311 100644 --- a/modules/module/queries/getLangListByLangcode.xml +++ b/modules/module/queries/getLangListByLangcode.xml @@ -10,6 +10,7 @@ + diff --git a/modules/module/tpl/multilingual_v17.html b/modules/module/tpl/multilingual_v17.html new file mode 100644 index 000000000..8e4e7d96d --- /dev/null +++ b/modules/module/tpl/multilingual_v17.html @@ -0,0 +1,48 @@ +{@ + /* move current language to the top */ + $a = array($lang_type=>$lang_supported[$lang_type]); + unset($lang_supported[$lang_type]); + $lang_supported = array_merge($a, $lang_supported); +} + + diff --git a/modules/module/tpl/multilingual_v17_list.html b/modules/module/tpl/multilingual_v17_list.html new file mode 100644 index 000000000..81c4b8039 --- /dev/null +++ b/modules/module/tpl/multilingual_v17_list.html @@ -0,0 +1,64 @@ +{@ + /* move current language to the top */ + $a = array($lang_type=>$lang_supported[$lang_type]); + unset($lang_supported[$lang_type]); + $lang_supported = array_merge($a, $lang_supported); +} +

{sprintf($lang->about_multilingual_search_result, $total_count)}

+
+
+ {$val->value} +
+ +
+ + + + + + + + +
+
+
+
+
+
+ +
+ +