diff --git a/modules/admin/tpl/_spHeader.html b/modules/admin/tpl/_spHeader.html index 70a69a149..e9fc230be 100644 --- a/modules/admin/tpl/_spHeader.html +++ b/modules/admin/tpl/_spHeader.html @@ -3,8 +3,8 @@

XE Super Admin

- Move to Site -
+ Move to Site +

Move to Site

  • XpressEngine - http://xe.xpressengine.net/
  • @@ -18,7 +18,7 @@
    • 정찬명
    • Log-out
    • -
    • Language +
    • Language
      • {$val}
      • diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js index 5d48d7445..faf56b42e 100644 --- a/modules/admin/tpl/js/admin.js +++ b/modules/admin/tpl/js/admin.js @@ -1,614 +1,407 @@ /* NHN (developers@xpressengine.com) */ jQuery(function($){ - // Label Overlapping - var overlapLabel = $('.form li').find('>:text,>:password,>textarea').prev('label'); - var overlapInput = overlapLabel.next(':text,:password,textarea'); - overlapLabel.css({'position':'absolute','top':'15px','left':'5px'}).parent().css('position','relative'); - overlapInput - .focus(function(){ - $(this).prev(overlapLabel).css('visibility','hidden'); - }) - .blur(function(){ - if($(this).val() == ''){ - $(this).prev(overlapLabel).css('visibility','visible'); - } else { - $(this).prev(overlapLabel).css('visibility','hidden'); - } - }) + // Overlapping label + $('.form li').find('>input:text,>input:password,>textarea') + .prev('label') + .css({position:'absolute',top:'15px',left:'5px'}) + .next() + .focus(function(){ + var $label = $(this).prev().stop().animate({opacity:0, left:'25px'},'fast',function(){ $label.css('visibility','hide') }); + }) + .blur(function(){ + var $this = $(this), $label; + if($.trim($this.val()) == '') { + $label = $this.prev().stop().css('visibility','visible').animate({opacity:1, left:'5px'},'fast'); + } + }) + .end() + .parent() + .css('position', 'relative'); + + // Make selected checkbox elements bold + var $rc_label = $('input:radio+label,input:checkbox+label'), $input_rc = $rc_label.prev('input'); + $input_rc .change(function(){ - if($(this).val() == ''){ - $(this).prev(overlapLabel).css('visibility','visible'); - } else { - $(this).prev(overlapLabel).css('visibility','hidden'); - } + var name = $(this).attr('name'); + $input_rc + .filter('[name="'+name+'"]:not(:checked)') + .next('label').css('font-weight', 'normal').end() + .end() + .next('label').css('font-weight', 'bold').end(); }) - .blur(); - // Checked - var inputRC = $('input[type=radio], input[type=checkbox]'); - inputRC.change(function(){ - var myName = $(this).attr('name'); - inputRC.filter('[name='+myName+']').not(':checked').next('label').css('fontWeight','normal'); - $(this).filter(':checked').next('label').css('fontWeight','bold'); - }); - inputRC.change(); - // Check All - var formThCheck = $('.form th>:checkbox'); - formThCheck.change(function(){ - var formTdCheck = $(this).parents('table').find('td>:checkbox'); - if($(this).is(':checked')){ - formTdCheck.attr('checked','checked').change(); - } else { - formTdCheck.removeAttr('checked').change(); - } - }); - formThCheck.change(); - // Global Navigation Bar - var gnb = $('div.gnb'); - var gnb_i = gnb.find('>ul>li'); - var gnb_a = gnb_i.find('>a'); - gnb.removeClass('jx'); - gnb_i.find('>ul').hide(); - gnb.find('>ul>li[class=active]').find('>ul').show(); - function gnbToggle(event){ - var t = $(this); - gnb_i.removeClass('active'); - if (t.next('ul').is(':hidden')) { - gnb_i.find('>ul').slideUp(100); - t.next('ul').slideDown(100); - t.parent('li').addClass('active'); - } else if (t.next('ul').is(':visible')){ - t.next('ul').show(); - t.parent('li').addClass('active'); - } else if (!t.next('ul').langth) { - gnb_i.find('>ul').slideUp(100); - t.parent('li').removeClass('active'); - }; - } - gnb_a.focus(gnbToggle).click(gnbToggle); - gnb_a.mouseover(function(){ - if($(document).width()>640){ - $(this).click(); - } else { - return false; - } - }); - gnb.mouseleave(function(){ - if($(document).width()>640){ - gnbToggle(); - } else { - return false; - } - }); - gnb.find('li:last-child>a, li:last-child>ul>li:last-child>a').blur(gnbToggle); - // Lined Tab Navigation - var tab_line = $('div.tab.line'); - var tab_line_i = tab_line.find('>ul>li'); - var tab_line_ii = tab_line.find('>ul>li>ul>li'); - tab_line.removeClass('jx'); - if($(document).width()<=640){ - tab_line.addClass('jx'); - } - $(window).resize(function(){ - if($(document).width()<=640){ - tab_line.addClass('jx'); - } else { - tab_line.removeClass('jx'); - } - }); - tab_line_i.find('>ul').hide(); - tab_line_i.find('>ul>li[class=active]').parents('li').attr('class','active'); - tab_line.find('>ul>li[class=active]').find('>ul').show(); - function lineTabMenuToggle(event){ - if (!tab_line.hasClass('jx')){ - var t = $(this); - tab_line_i.find('>ul').hide(); - t.next('ul').show(); - tab_line_i.removeClass('active'); - t.parent('li').addClass('active'); - return false; - } - } - function lineTabSubMenuActive(){ - tab_line_ii.removeClass('active'); - $(this).parent(tab_line_ii).addClass('active'); - return false; - }; - tab_line_i.find('>a[href=#]').click(lineTabMenuToggle).focus(lineTabMenuToggle); - tab_line_ii.find('>a[href=#]').click(lineTabSubMenuActive).focus(lineTabSubMenuActive); - // Faced Tab Navigation - var tab_face = $('div.tab.face'); - var tab_face_i = tab_face.find('>ul>li'); - var tab_face_ii = tab_face.find('>ul>li>ul>li'); - tab_face.removeClass('jx'); - if($(document).width()<=640){ - tab_face.addClass('jx'); - } - $(window).resize(function(){ - if($(document).width()<=640){ - tab_face.addClass('jx'); - } else { - tab_face.removeClass('jx'); - } - }); - tab_face_i.find('>ul').hide(); - tab_face_i.find('>ul>li[class=active]').parents('li').attr('class','active'); - tab_face.find('>ul>li[class=active]').find('>ul').show(); - function faceTabMenuToggle(event){ - if (!tab_face.hasClass('jx')){ - var t = $(this); - tab_face_i.find('>ul').hide(); - t.next('ul').show(); - tab_face_i.removeClass('active'); - t.parent('li').addClass('active'); - return false; - } - } - function faceTabSubMenuActive(){ - tab_face_ii.removeClass('active'); - $(this).parent(tab_face_ii).addClass('active'); - return false; - }; - tab_face_i.find('>a[href=#]').click(faceTabMenuToggle).focus(faceTabMenuToggle); - tab_face_ii.find('>a[href=#]').click(faceTabSubMenuActive).focus(faceTabSubMenuActive); - // List Tab Navigation - var tab_list = $('div.tab.list'); - var tab_list_i = tab_list.find('>ul>li'); - tab_list.removeClass('jx'); - if($(document).width()<=640){ - tab_list.addClass('jx'); - } - $(window).resize(function(){ - if($(document).width()<=640){ - tab_list.addClass('jx'); - tab_list.css('height','auto'); - } else { - tab_list.removeClass('jx'); - tab_list.css('height', tab_list.find('>ul>li.active>ul').height()+40); - } - }); - tab_list_i.find('>ul').hide(); - tab_list.find('>ul>li[class=active]').find('>ul').show(); - if (!tab_list.hasClass('jx')){ - tab_list.css('height', tab_list.find('>ul>li.active>ul').height()+40); - } else { - tab_list.css('height','auto'); - } - function listTabMenuToggle(event){ - if (!tab_list.hasClass('jx')){ - var t = $(this); - tab_list_i.find('>ul').hide(); - t.next('ul').show(); - tab_list_i.removeClass('active'); - t.parent('li').addClass('active'); - tab_list.css('height', t.next('ul').height()+40); - return false; - } - } - tab_list_i.find('>a[href=#]').click(listTabMenuToggle).focus(listTabMenuToggle); - // Vertical Navigation - var vNav = $('div.vNav'); - var vNav_i = vNav.find('>ul>li'); - var vNav_ii = vNav.find('>ul>li>ul>li'); - vNav_i.find('>ul').hide(); - vNav.find('>ul>li>ul>li[class=active]').parents('li').attr('class','active'); - vNav.find('>ul>li[class=active]').find('>ul').show(); - function vNavToggle(event){ - var t = $(this); - if (t.next('ul').is(':hidden')) { - vNav_i.find('>ul').slideUp(100); - t.next('ul').slideDown(100); - } else if (t.next('ul').is(':visible')){ - t.next('ul').show(); - } else if (!t.next('ul').langth) { - vNav_i.find('>ul').slideUp(100); - } - vNav_i.removeClass('active'); - t.parent('li').addClass('active'); - return false; - } - vNav_i.find('>a[href=#]').click(vNavToggle).focus(vNavToggle); - function vNavActive(){ - vNav_ii.removeClass('active'); - $(this).parent(vNav_ii).addClass('active'); - return false; - }; - vNav_ii.find('>a[href=#]').click(vNavActive).focus(vNavActive); - vNav.find('>ul>li>ul').prev('a').append(''); - // Tree Navigation - var tNav = $('.tNav'); - var tNavPlus = ''; - var tNavMinus = ''; - tNav.find('li>ul').css('display','none'); - tNav.find('ul>li:last-child').addClass('last'); - tNav.find('li>ul:hidden').parent('li').prepend(tNavPlus); - tNav.find('li>ul:visible').parent('li').prepend(tNavMinus); - tNav.find('li.active').addClass('open').parents('li').addClass('open'); - tNav.find('li.open').parents('li').addClass('open'); - tNav.find('li.open>.tNavToggle').text('-').removeClass('plus').addClass('minus'); - tNav.find('li.open>ul').slideDown(100); - $('.tNav .tNavToggle').click(function(){ - t = $(this); - t.parent('li').toggleClass('open'); - if(t.parent('li').hasClass('open')){ - t.text('-').removeClass('plus').addClass('minus'); - t.parent('li').find('>ul').slideDown(100); - } else { - t.text('+').removeClass('minus').addClass('plus'); - t.parent('li').find('>ul').slideUp(100); - } - return false; - }); - $('.tNav a[href=#]').click(function(){ - t = $(this); - t.parent('li').toggleClass('open'); - if(t.parent('li').hasClass('open')){ - t.prev('button.tNavToggle').text('-').removeClass('plus').addClass('minus'); - t.parent('li').find('>ul').slideDown(100); - } else { - t.prev('button.tNavToggle').text('+').removeClass('minus').addClass('plus'); - t.parent('li').find('>ul').slideUp(100); - } - return false; - }); - // Frequently Asked Question - var article = $('.faq>.faqBody>.article'); - article.addClass('hide'); - article.find('.a').hide(); - article.eq(0).removeClass('hide'); - article.eq(0).find('.a').show(); - $('.faq>.faqBody>.article>.q>a').click(function(){ - var myArticle = $(this).parents('.article:first'); - if(myArticle.hasClass('hide')){ - article.addClass('hide').removeClass('show'); - article.find('.a').slideUp(100); - myArticle.removeClass('hide').addClass('show'); - myArticle.find('.a').slideDown(100); - } else { - myArticle.removeClass('show').addClass('hide'); - myArticle.find('.a').slideUp(100); - } - return false; - }); - $('.faq>.faqHeader>.showAll').click(function(){ - var hidden = $('.faq>.faqBody>.article.hide').length; - if(hidden > 0){ - article.removeClass('hide').addClass('show'); - article.find('.a').slideDown(100); - } else { - article.removeClass('show').addClass('hide'); - article.find('.a').slideUp(100); - } - }); - // Layer - var layerAnchor = $('.layerAnchor[href^=#]'); - var layer = $('.layer'); - var layerCloseHtml = ''; - var layerBlurHtml = ''; - layer.hide().prepend(layerCloseHtml); - var layerClose = $('.layerClose'); - layerClose.eq(0).clone().appendTo(layer); - layer.prepend(layerBlurHtml); - var layerBlur = $('.layerBlur'); - layerBlur.eq(0).clone().appendTo(layer); - layerAnchor - .click(function(){ - $($(this).attr('href')).fadeToggle(200).find('>.layerClose:first').focus(); - return false; - }) - .keypress(function(){ - if(event.keyCode != 32) return true; - $(this).click(); - return false; + .change(); + + // Toogle checkbox all + $('.form th>:checkbox') + .change(function() { + var $this = $(this), self = this, name; + + name = $this.data('target'); + $this.closest('table').find('input:checkbox') + .filter(function(){ return (this.name == name) }) + .prop('checked', $this.prop('checked')) + .filter(function(){ return (this.parentNode.nodeName != 'TH') }) + .change(); }); - function closeLayer() { - var closeId = layer.filter(':visible').attr("id"); - if(closeId) layerAnchor.filter('[href="#'+closeId+'"]').focus(); - layer.fadeOut(200); - } - $(document).keydown(function(event){ - if(event.keyCode != 27) return true; // ESC - return closeLayer(); - }); - $('.layerClose').click(closeLayer); - $('.layerBlur').focusin(function(event){ - layerClose.click(); - }); - // Modal Window - var htmlBody = $('html,body'); - var modalAnchor = $('.modalAnchor'); - var modal = $('.modal'); - var modalBg = modal.find('>.bg'); - var modalFg = modal.find('>.fg'); - var modalCloseHtml = ''; - var modalBlurHtml = ''; - modal + + // Global Navigation Bar + var $menuitems = $('div.gnb') + .removeClass('jx') + .attr('role', 'navigation') // WAI-ARIA role + .find('li') + .attr('role', 'menuitem') // WAI-ARIA role + .filter(':has(>ul)') + .attr('aria-haspopup', 'true') // WAI-ARIA + .find('>ul').hide().end() + .mouseover(function(){ + var $this = $(this); + if($this.css('float') == 'left') $this.find('>ul:hidden').prev('a').click(); + }) + .mouseleave(function(){ + var $this = $(this); + if($this.css('float') == 'left') $this.find('>ul:visible').slideUp(100); + }) + .find('>a') + .focus(function(){ $(this).click() }) + .click(function(){ + $menuitems.removeClass('active'); + + $(this) + .next('ul').slideToggle(100).end() + .parent().addClass('active'); + + return false; + }) + .end() + .end() + .find('>a') + .blur(function(){ + var anchor = this; + setTimeout(function(){ + var $a = $(anchor), $ul = $a.closest('ul'), $focus = $ul.find('a:focus'); + + if(!$focus.length || $focus.closest('ul').parent('div.gnb').length) { + if($ul.parent('div.gnb').length) $ul = $a.next('ul'); + $ul.filter(':visible').slideUp(100); + } + }, 10); + }) + .end() + + // TODO: Modal Window +// var htmlBody = $('html,body'); +// var modalAnchor = $('.modalAnchor'); +// var modal = $('.modal'); +// var modalBg = modal.find('>.bg'); +// var modalFg = modal.find('>.fg'); +// var modalCloseHtml = ''; +// var modalBlurHtml = ''; +// var docHeight = $(document).height(); + $('.modal') .hide() .appendTo('body') - .height($(document).height()) .prepend('') .append(''); - modalFg - .prepend(modalCloseHtml) - .prepend(modalBlurHtml); - var modalClose = $('.modalClose'); - var modalBlur = $('.modalBlur'); - modalClose.eq(0).clone().appendTo(modalFg); - modalBlur.eq(0).clone().appendTo(modalFg); - modalAnchor - .click(function(){ - if(typeof document.body.style.maxHeight == "undefined"){ - htmlBody.css({'width':'100%','height':'100%'}); - } - modal.fadeToggle(200).toggleClass('modalActive'); - modalFg.find('>.modalClose:first').focus(); - $(this).addClass('active'); - }) - .keypress(function(){ - if(event.keyCode != 32) return true; - $(this).click(); - return false; - }); - function closeModal() { - if(typeof document.body.style.maxHeight == "undefined"){ - htmlBody.removeAttr('style'); - } - modal.fadeOut(200).removeClass('modalActive'); - $('.modalAnchor.active').focus().removeClass('active'); - return false; - } - $(document).keydown(function(event){ - if(event.keyCode != 27) return true; // ESC - if(modal.find('.tgContent:visible').length == 0) return closeModal(); - }); - $('.modal>.bg, .modalClose, .modal .cancel').click(closeModal); - $('.modalBlur').focusin(function(event){ - modalClose.click(); - }); - // Toggle - var tgContent = $('.tgContent'); - var tgBlurHtml = ''; - tgContent.hide().prepend(tgBlurHtml).mouseleave(function(){closeTg()}); - var tgBlur = $('.tgBlur'); - tgBlur.eq(0).clone().appendTo(tgContent); - function offsetToggle(){ - tgContent.filter(':visible').parent().css('position','relative'); - setTimeout(function(){ - tgContent.filter(':hidden').parent().css('position',''); - }, 300); - } - $('.tgSimple').click(function(){ - $($(this).attr('href')).toggle().find('a, input, button:not(.tgBlur), select, textarea').eq(0).focus(); - offsetToggle(); - return false; - }); - $('.tgSlide').click(function(){ - $($(this).attr('href')).slideToggle(100).find('a, input, button:not(.tgBlur), select, textarea').eq(0).focus(); - offsetToggle(); - return false; - }); - $('.tgFade').click(function(){ - $($(this).attr('href')).fadeToggle(200).find('a, input, button:not(.tgBlur), select, textarea').eq(0).focus(); - offsetToggle(); - return false; - }); - $('.tgSimple, .tgSlide, .tgFade').keypress(function(){ - if(event.keyCode != 32) return true; - $(this).click(); - return false; - }); - function closeTg() { - var closeId = tgContent.filter(':visible').attr('id'); - if(closeId) $('.tgSimple, .tgSlide, .tgFade').filter('[href="#'+closeId+'"]').focus(); - tgContent.prev('input').focus(); - tgContent.fadeOut(200); - } - $(document).keydown(function(event){ - if(event.keyCode != 27) return true; // ESC - return closeTg(); - }); - $('.tgBlur').focusin(closeTg); - // Portlet Action - var action = $('.portlet .action'); - var action_li = action.parent('li'); - action.hide().css({'position':'absolute'}); - action_li.mouseleave(function(){ - action.fadeOut(100); - return false; - }); - action_li.mouseenter(function(){ - action_li.mouseleave(); - $(this).find('>.action').fadeIn(100); - return false; - }); - action_li.find('*:first-child').focusin(function(){ - $(this).parent('li').mouseenter(); - }); - // Waiting for server response - var htmlBody = $('html,body'); - var wfsrAnchor = $('.wfsrAnchor'); - $('body').append('

        서버에 요청중입니다. 잠시만 기다려 주세요.

        '); - var wfsr = $('#wfsr'); - var wfsrBg = wfsr.find('>.bg'); - var wfsrFg = wfsr.find('>.fg'); - wfsr.hide(); - wfsr.append(''); - wfsrAnchor.click(function(){ - htmlBody.css({'width':'100%','height':'100%'}); - wfsr.fadeToggle(200).addClass('wfsrActive'); - wfsrFg.find('.reAction:first').focus(); - $(this).addClass('active'); - }); - function closeWfsr() { - htmlBody.removeAttr('style'); - wfsr.fadeOut(200).removeClass('wfsrActive'); - $('.wfsrAnchor.active').focus().removeClass('active'); - return false; - } - $(document).keydown(function(event){ - if(event.keyCode != 27) return true; // ESC - closeWfsr(); - }); - $('#wfsr .reAction, #wfsr .cancel').click(closeWfsr); - // Delete - $('.delete').click(function(){ - confirm('Delete this(these)? Undo is impossible.'); - }); - // Section Collapse - var h2 = $('.content:not(.dashboard) .h2:gt(0)'); - var h2AnchorHTML = ''; - h2 - .append(h2AnchorHTML) - .each(function(){ - $(this).parent().children().not('.h2').hide(); - $(this).find('.h2Anchor') - .text('Show') +// modalFg +// .prepend(modalCloseHtml) +// .prepend(modalBlurHtml); +// var modalClose = $('.modalClose'); +// var modalBlur = $('.modalBlur'); +// modalClose.eq(0).clone().appendTo(modalFg); +// modalBlur.eq(0).clone().appendTo(modalFg); +// modalAnchor +// .click(function(){ +// if(typeof document.body.style.maxHeight == "undefined"){ +// htmlBody.css({'width':'100%','height':'100%'}); +// } +// var myTarget = $($(this).attr('href')); +// myTarget.fadeToggle(200).toggleClass('modalActive'); +// myTarget.find('>.fg>.modalClose:first').focus(); +// $(this).addClass('active'); +// }) +// .keypress(function(){ +// if(event.keyCode != 32) return true; +// $(this).click(); +// return false; +// }); +// function closeModal() { +// if(typeof document.body.style.maxHeight == "undefined"){ +// htmlBody.removeAttr('style'); +// } +// modal.fadeOut(200).removeClass('modalActive'); +// $('.modalAnchor.active').focus().removeClass('active'); +// return false; +// } +// $(document).keydown(function(event){ +// if(event.keyCode != 27) return true; // ESC +// if(modal.find('.tgContent:visible').length == 0) return closeModal(); +// }); +// $('.modal>.bg, .modalClose, .modal .cancel').click(closeModal); +// $('.modalBlur').focusin(function(event){ +// modalClose.click(); +// }); + + // pagination + $('.pagination') + .find('span.gotopage') + .attr('id', function(idx){ return 'gotopage-'+(idx+1) }) + .hide() + .end() + .find('a[href="#gotopage"]') + .each(function(idx){ + var id = '#gotopage-'+(idx+1); + $(this).attr('href', id).after($(id)); + }) .click(function(){ - var t = $(this); - t.parent('.h2').parent().children().not('.h2').slideToggle(200); - setTimeout(function(event){ - if(t.parent('.h2').next().is(':visible')) { - t.text('Hide'); - } else { - t.text('Show'); - } - }, 300); - }); - }); - // Site Map - var siteMap = $('.siteMap'); - var siteItem = siteMap.find('li'); - siteItem - .prepend('') - .append('') - .mouseover(function(){ - $(this).addClass('active'); - $('.vr').each(function(){ - var myHeight = $(this).parent('li').height(); - $(this).height(myHeight); - }); + var $form, width, height, hidden, duration; + console.log(this); + + $form = $(this.getAttribute('href')); + hidden = $form.is(':hidden'); + width = $form.show().width(); + height = $form.height(); + duration = 100; + + $form.css('overflow', 'hidden').css('whiteSpace', 'nowrap'); + if(hidden) { + $form + .css('width', 0) + .animate({width:width}, duration, function(){ $form.css({width:'',height:'',overflow:''}) }) + .find('input:text:first').focus(); + } else { + $form + .css('width', width) + .animate({width:0}, duration, function(){ $form.hide().css({width:'',height:'',overflow:''}) }); + + $(this).focus(); + } + + return false; + }) + .end(); + + // TODO: Portlet Action +// var action = $('.portlet .action'); +// var action_li = action.parent('li'); +// action.hide().css({'position':'absolute'}); +// action_li.mouseleave(function(){ +// action.fadeOut(100); +// return false; +// }); +// action_li.mouseenter(function(){ +// action_li.mouseleave(); +// $(this).find('>.action').fadeIn(100); +// return false; +// }); +// action_li.find('*:first-child').focusin(function(){ +// $(this).parent('li').mouseenter(); +// }); + + // TODO: Site Map +// var siteMap = $('.siteMap'); +// var siteItem = siteMap.find('li'); +// siteItem +// .prepend('') +// .append('') +// .mouseover(function(){ +// $(this).addClass('active'); +// $('.vr').each(function(){ +// var myHeight = $(this).parent('li').height(); +// $(this).height(myHeight); +// }); +// return false; +// }) +// .mouseout(function(){ +// $(this).removeClass('active'); +// }) +// .find('.moveTo+input').each(function(){ +// $(this).width(this.value.length+'em'); +// }); +// siteMap.find('.moveTo') +// .focus(function(){ +// $(this).parent('li').mouseover(); +// }) +// .blur(function(){ +// $(this).mouseout(); +// }); +// siteMap.find('li:first-child').css('border','0'); + + // Toggle Contents + $('a.tgAnchor') + .click(function(){ + var $this = $(this), $layer; + + // get content container + $layer = $( $this.attr('href') ); + + // set anchor object + $layer.data('anchor', $this); + + if($layer.data('state') == 'showing') { + $this.trigger('close.tc'); + } else { + $this.trigger('open.tc'); + } + return false; }) - .mouseout(function(){ + .bind('open.tc', function(){ + var $this = $(this), $layer, effect, duration; + + // get content container + $layer = $( $this.attr('href') ); + + // get effeect + effect = $this.data('effect'); + + // get duration + duration = $this.data('duration') || 'fast'; + + // before event trigger + $this.trigger('before-open.tc'); + + // set state : showing + $layer.data('state', 'showing'); + + // When mouse button is down or when ESC key is pressed close this layer + $(document) + .unbind('mousedown.tc keydown.tc') + .bind('mousedown.tc keydown.tc', + function(event){ + if(event && ( + (event.type == 'keydown' && event.which != 27) || // '27' means ESC key + (event.type == 'mousedown' && ($(event.target).is('.tgAnchor,.tgContent') || $layer.has(event.target)[0])) + )) return true; + + $this.trigger('close.tc'); + + return false; + } + ); + + switch(effect) { + case 'slide': + $layer.slideDown(duration, function(){ $this.trigger('after-open.tc') }); + break; + case 'fade': + $layer.fadeIn(duration, function(){ $this.trigger('after-open.tc') }); + break; + default: + $layer.show(); + $this.trigger('after-open.tc'); + } + }) + .bind('close.tc', function(){ + var $this = $(this), $layer, effect, duration; + + // get content container + $layer = $( $this.attr('href') ); + + // get effeect + effect = $this.data('effect'); + + // get duration + duration = $this.data('duration') || 'fast'; + + // before event trigger + $this.trigger('before-close.tc'); + + $(document).unbind('mousedown.tc keydown.tc'); + + // set state : hiding + $layer.data('state', 'hiding'); + + // close this layer + switch(effect) { + case 'slide': + $layer.slideUp(duration, function(){ $this.trigger('after-close.tc') }); + break; + case 'fade': + $layer.fadeOut(duration, function(){ $this.trigger('after-close.tc') }); + break; + default: + $layer.hide(); + $this.trigger('after-close.tc'); + } + }); + $('.tgContent') + .hide() + .focusout(function(){ + var $this = $(this), $anchor = $this.data('anchor'); + setTimeout(function(){ + if(!$this.find(':focus').length) $anchor.trigger('close.tc'); + }, 1); + }) + + // Popup list : 'Move to site' and 'Site map' + $('.header>.siteTool>a.i') + .bind('before-open.tc', function(){ + $(this) + .addClass('active') + .next('div.tgContent') + .find('>.section:gt(0)').hide().end() + .find('>.btnArea>button').show(); + }) + .bind('after-close.tc', function(){ $(this).removeClass('active'); }) - .find('.moveTo+input').each(function(){ - $(this).width(this.value.length+'em'); - }); - siteMap.find('.moveTo') - .focus(function(){ - $(this).parent('li').mouseover(); - }) - .blur(function(){ - $(this).mouseout(); - }); - siteMap.find('li:first-child').css('border','0'); - // Site Map List(Layer) - var siteMapList = $('#siteMapList'); - siteMapList.find('.portlet').hide().eq(0).show(); - siteMapList.append('

        '); - var siteMapMore = siteMapList.find('.btnArea>button'); - siteMapMore.click(function(){ - if(siteMapList.find('.portlet:visible').length <= 1){ - siteMapList.find('.portlet').slideDown(200); - $(this).html('› less'); - } else { - siteMapList.find('.portlet').eq(!0).slideUp(200); - $(this).html('› more'); - } - }); - // Mid Suggestion - var midUrl = $('#midUrl'); - var midSuggestion = $('#midSuggestion'); - var findModule = $('#findModule'); - midSuggestion.css('position','absolute'); - midUrl.keypress(function(){ - $(this).next('.tgContent').fadeIn(200); - midUrl.css('background','url(./img/preLoader16.gif) no-repeat 268px center'); - }); - midUrl.keyup(function(){ - midUrl.css('background',''); - }); - midSuggestion - .find('li:first-child>button').css('fontWeight','bold').end() - .find('li:gt(0)>button').click(function(){ - var myValue = $(this).text(); - midUrl.val(myValue); - return closeTg(); - }); - findModule.find('td>button').click(function(){ - var myValue = $(this).parent('td').parent('tr').find('th:first a').eq(0).text(); - midUrl.val(myValue); - return closeTg(); - }); - // Theme & Skin Preview - $('.thumbPreview') - .find('.thumb') - .each(function(){ - if($(this).find('img').length==0 && $(this).text().length==0){ - $(this).text('Thumbnail does not exist'); - } - $(this).click(function(){ - $(this).next(':radio').attr('checked','checked'); - $(this).parents('.thumbPreview').find(':radio').change(); - }); - }); - var themePreview = $('#theme>.thumbPreview'); - var skinPreview = $('#skin>.thumbPreview'); - function iCheck(){ - skinPreview.find('.i').removeClass('checked'); - skinPreview.find(':radio:checked').prev('.thumb').parent('.i').addClass('checked'); - themePreview.find('.i').removeClass('checked'); - themePreview.find(':radio:checked').prev('.thumb').parent('.i').addClass('checked'); - } - iCheck(); - skinPreview.find(':radio').change(function(){ - themePreview.find('label').css('fontWeight',''); - themePreview.find(':radio:last').attr('checked','checked').next('label').css('fontWeight','bold'); - iCheck(); - }); - themePreview.find(':radio').change(function(){ - if($(this).is(':checked') && skinPreview.is(':hidden')){ - $('#skin').find('.h2Anchor').click(); - } - iCheck(); - }); - // FTP Suggestion - var ftp_path = $('#ftp_path'); - var ftpSuggestion = $('#ftpSuggestion'); - ftpSuggestion.css('position','absolute').find('.tgBlur').eq(0).remove(); - ftpSuggestion.find('li:not(:first-child)>button').click(function(){ - var setValue = ftp_path.val(); - var myValue = $(this).text(); - ftp_path.val(setValue+myValue); - }); - // Sign Up Form - var signUpForm = $('.signUpForm'); - signUpForm - .find('li').each(function(){ - $(this).append(' '); - }).end() - .find('.btnArea>.side').remove().end() - .find('.userItem>.side').each(function(){ - $(this).append(' '); - }); - signUpForm.find('.up').click(function(){ - var myItem = $(this).parent('.side').parent('li'); - myItem.prev('li').before(myItem); - myItem.css('background','#ffc'); - setTimeout(function(){ - myItem.css('background','#fff'); - }, 2000); - }); - signUpForm.find('.down').click(function(){ - var myItem = $(this).parent('.side').parent('li'); - myItem.next('li').after(myItem); - myItem.css('background','#ffc'); - setTimeout(function(){ - myItem.css('background','#fff'); - }, 2000); - }); - signUpForm.find('.edit').click(function(){ - $('.modalAnchor').click(); - }); -}); + .next('#siteMapList') + .find('>.section:last') + .after('

        ') + .find('+p>button') + .click(function(){ + // Display all sections then hide this button + $(this).hide().parent().prevAll('.section').show(); + }); + // TODO : Suggestion +// var suggestion = $('#suggestion'); +// var snTarget = suggestion.prev('input[type=text]'); +// suggestion.css('position','absolute'); +// snTarget.keypress(function(){ +// $(this).next('.tgContent').fadeIn(200); +// snTarget.css('background','url(./img/preLoader16.gif) no-repeat 268px center'); +// }); +// snTarget.keyup(function(){ +// snTarget.css('background',''); +// }); +// suggestion +// .find('li:first-child>button').css('fontWeight','bold').end() +// .find('li:gt(0)>button').click(function(){ +// var myValue = $(this).text(); +// snTarget.val(myValue); +// return closeTg(); +// }); + + // TODO: FTP Suggestion +// var ftp_path = $('#ftp_path'); +// var ftpSuggestion = $('#ftpSuggestion'); +// ftpSuggestion.css('position','absolute').find('.tgBlur').eq(0).remove(); +// ftpSuggestion.find('li:not(:first-child)>button').click(function(){ +// var setValue = ftp_path.val(); +// var myValue = $(this).text(); +// ftp_path.val(setValue+myValue); +// }); + + // TODO: Up-Down Dragable +// var uDrag = $('.uDrag'); +// uDrag.find('>tr>td:first-child, >li').wrapInner('
        '); +// var uDragWrap = $('.uDrag .wrap'); +// uDragWrap +// .prepend('') +// .each(function(){ +// var t = $(this); +// var tHeight = t.parent().height(); +// if(t.parent().is('td')){ +// t.height(tHeight); +// } +// }); +// var uDragItem = $('.uDrag>tr, .uDrag>li'); +// uDragItem +// .mouseenter(function(){ +// $(this).addClass('dragActive'); +// }) +// .mouseleave(function(){ +// $(this).removeClass('dragActive'); +// }); +}); diff --git a/modules/comment/comment.admin.controller.php b/modules/comment/comment.admin.controller.php index 59065bcce..ff7a414b1 100644 --- a/modules/comment/comment.admin.controller.php +++ b/modules/comment/comment.admin.controller.php @@ -102,6 +102,20 @@ } } + function procCommentAdminAddCart() + { + $comment_srl = Context::get('comment_srl'); + $commentSrlList = explode(',', $comment_srl); + + if(is_array($commentSrlList)) + { + foreach($commentSrlList AS $key=>$value) + { + $_SESSION['comment_management'][$value] = true; + } + } + } + /** * @brief delete all comments of the specific module **/ diff --git a/modules/comment/comment.admin.view.php b/modules/comment/comment.admin.view.php index f7f4f99e7..2604d15e5 100644 --- a/modules/comment/comment.admin.view.php +++ b/modules/comment/comment.admin.view.php @@ -28,14 +28,21 @@ // get a list by using comment->getCommentList. $oCommentModel = &getModel('comment'); - $columnList = array('comment_srl', 'document_srl', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress'); + $secretNameList = $oCommentModel->getSecretNameList(); + $columnList = array('comment_srl', 'document_srl', 'is_secret', 'content', 'comments.member_srl', 'comments.nick_name', 'comments.regdate', 'ipaddress'); $output = $oCommentModel->getTotalCommentList($args, $columnList); + + // get total comment count group by is_secret status + $countOutput = $oCommentModel->getTotalCommentCount($args); + // set values in the return object of comment_model:: getTotalCommentList() in order to use a template. Context::set('total_count', $output->total_count); Context::set('total_page', $output->total_page); Context::set('page', $output->page); Context::set('comment_list', $output->data); Context::set('page_navigation', $output->page_navigation); + Context::set('secret_name_list', $secretNameList); + Context::set('countOutput', $countOutput); // set the template $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('comment_list'); diff --git a/modules/comment/comment.controller.php b/modules/comment/comment.controller.php index 27f20371e..d47b33f78 100644 --- a/modules/comment/comment.controller.php +++ b/modules/comment/comment.controller.php @@ -628,5 +628,27 @@ $oModuleController->insertModulePartConfig('comment',$srl,$comment_config); return new Object(); } + + /** + * @brief get comment all list + **/ + function procCommentGetList() + { + if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); + // Taken from a list of selected sessions + $flagList = $_SESSION['comment_management']; + if(count($flagList)) { + foreach($flagList as $key => $val) { + if(!is_bool($val)) continue; + $commentSrlList[] = $key; + } + } + + if(count($commentSrlList)) { + $oCommentModel = &getModel('comment'); + $commentList = $oCommentModel->getComments($commentSrlList); + } + $this->add('comment_list', $commentList); + } } ?> diff --git a/modules/comment/comment.item.php b/modules/comment/comment.item.php index 2a823e7dc..1b3dc95a5 100644 --- a/modules/comment/comment.item.php +++ b/modules/comment/comment.item.php @@ -396,5 +396,8 @@ return; } + function isCarted() { + return $_SESSION['comment_management'][$this->comment_srl]; + } } ?> diff --git a/modules/comment/comment.model.php b/modules/comment/comment.model.php index 5a3fb5098..2b74bad8c 100644 --- a/modules/comment/comment.model.php +++ b/modules/comment/comment.model.php @@ -372,6 +372,9 @@ case 'ipaddress' : $args->s_ipaddress= $search_keyword; break; + case 'is_secret' : + $args->s_is_secret= $search_keyword; + break; case 'member_srl' : $args->{"s_".$search_target} = (int)$search_keyword; break; @@ -391,6 +394,68 @@ return $output; } + /** + * @brief get all the comment count in time decending order(for administrators) + **/ + function getTotalCommentCount($obj) { + $query_id = 'comment.getTotalCommentCountByGroupStatus'; + // Variables + $args->s_module_srl = $obj->module_srl; + $args->exclude_module_srl = $obj->exclude_module_srl; + // Search options + $search_target = $obj->search_target?$obj->search_target:trim(Context::get('search_target')); + $search_keyword = $obj->search_keyword?$obj->search_keyword:trim(Context::get('search_keyword')); + if($search_target && $search_keyword) { + switch($search_target) { + case 'content' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_content = $search_keyword; + break; + case 'user_id' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_id = $search_keyword; + $query_id = 'comment.getTotalCommentCountWithinMemberByGroupStatus'; + break; + case 'user_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_user_name = $search_keyword; + break; + case 'nick_name' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_nick_name = $search_keyword; + break; + case 'email_address' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_email_address = $search_keyword; + break; + case 'homepage' : + if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword); + $args->s_homepage = $search_keyword; + break; + case 'regdate' : + $args->s_regdate = $search_keyword; + break; + case 'last_update' : + $args->s_last_upate = $search_keyword; + break; + case 'ipaddress' : + $args->s_ipaddress= $search_keyword; + break; + case 'is_secret' : + $args->s_is_secret= $search_keyword; + break; + case 'member_srl' : + $args->{"s_".$search_target} = (int)$search_keyword; + break; + } + } + $output = executeQueryArray($query_id, $args); + // return when no result or error occurance + if(!$output->toBool()||!count($output->data)) return $output; + + return $output->data; + } + /** * @brief return a configuration of comments for each module **/ @@ -438,5 +503,13 @@ $this->add('voted_member_list',$output->data); } + + function getSecretNameList() + { + global $lang; + if(!isset($lang->secret_name_list)) + return array('Y'=>'Secret', 'N'=>'Public'); + else return $lang->secret_name_list; + } } ?> diff --git a/modules/comment/conf/module.xml b/modules/comment/conf/module.xml index ed75c73c8..f800cdc05 100644 --- a/modules/comment/conf/module.xml +++ b/modules/comment/conf/module.xml @@ -1,7 +1,10 @@ - + + + + @@ -13,6 +16,8 @@ + + diff --git a/modules/comment/lang/en.lang.php b/modules/comment/lang/en.lang.php index 0da475773..751df21cc 100644 --- a/modules/comment/lang/en.lang.php +++ b/modules/comment/lang/en.lang.php @@ -27,6 +27,7 @@ 'regdate' => 'Date', 'last_update' => 'Last update', 'ipaddress' => 'IP Address', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/es.lang.php b/modules/comment/lang/es.lang.php index 539ec1be8..4501f8370 100644 --- a/modules/comment/lang/es.lang.php +++ b/modules/comment/lang/es.lang.php @@ -27,6 +27,7 @@ 'regdate' => 'Fecha del registro', 'last_update' => 'Ultima actualización', 'ipaddress' => 'Dirección IP', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/fr.lang.php b/modules/comment/lang/fr.lang.php index b6b5a88be..97e624e14 100644 --- a/modules/comment/lang/fr.lang.php +++ b/modules/comment/lang/fr.lang.php @@ -28,6 +28,7 @@ 'regdate' => 'Jour', 'last_update' => 'Mise à Jour', 'ipaddress' => 'Adresse IP', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/jp.lang.php b/modules/comment/lang/jp.lang.php index 925f6ab95..19963db68 100644 --- a/modules/comment/lang/jp.lang.php +++ b/modules/comment/lang/jp.lang.php @@ -28,6 +28,7 @@ 'regdate' => '登録日', 'last_update' => '最終更新日 ', 'ipaddress' => 'IPアドレス', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/ko.lang.php b/modules/comment/lang/ko.lang.php index f78c98402..2b7bea575 100644 --- a/modules/comment/lang/ko.lang.php +++ b/modules/comment/lang/ko.lang.php @@ -25,6 +25,8 @@ 'regdate' => '등록일', 'last_update' => '최근수정일 ', 'ipaddress' => 'IP 주소', + 'is_secret' => '상태', ); $lang->no_text_comment = '텍스트가 없는 댓글입니다.'; + $lang->secret_name_list = array('Y'=>'비밀', 'N'=>'공개'); ?> diff --git a/modules/comment/lang/ru.lang.php b/modules/comment/lang/ru.lang.php index cba37eb9c..d84a4db16 100644 --- a/modules/comment/lang/ru.lang.php +++ b/modules/comment/lang/ru.lang.php @@ -28,6 +28,7 @@ 'regdate' => 'Дата регистрации', 'last_update' => 'Дата последнего обновления', 'ipaddress' => 'IP-адрес', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/tr.lang.php b/modules/comment/lang/tr.lang.php index 0db6a0b8e..9c9654017 100644 --- a/modules/comment/lang/tr.lang.php +++ b/modules/comment/lang/tr.lang.php @@ -27,6 +27,7 @@ 'regdate' => 'Tarih', 'last_update' => 'Son Güncelleştirme', 'ipaddress' => 'IP Adresi', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'Bu yorumda herhangi bir metin yok.'; diff --git a/modules/comment/lang/vi.lang.php b/modules/comment/lang/vi.lang.php index 8e5055db0..d2eb40d6a 100644 --- a/modules/comment/lang/vi.lang.php +++ b/modules/comment/lang/vi.lang.php @@ -29,6 +29,7 @@ 'regdate' => 'Ngày', 'last_update' => 'Cập nhật lần cuối', 'ipaddress' => 'IP', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/zh-CN.lang.php b/modules/comment/lang/zh-CN.lang.php index ae00078ad..9f8c554f0 100644 --- a/modules/comment/lang/zh-CN.lang.php +++ b/modules/comment/lang/zh-CN.lang.php @@ -28,6 +28,7 @@ 'regdate' => '日期', 'last_update' => '最后更新 ', 'ipaddress' => 'IP 地址', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/lang/zh-TW.lang.php b/modules/comment/lang/zh-TW.lang.php index 213b23fb6..6e0f55997 100644 --- a/modules/comment/lang/zh-TW.lang.php +++ b/modules/comment/lang/zh-TW.lang.php @@ -28,6 +28,7 @@ 'regdate' => '日期', 'last_update' => '最後更新', 'ipaddress' => 'IP位址', + 'is_secret' => 'Status', ); $lang->no_text_comment = 'No text in this comment.'; diff --git a/modules/comment/queries/getTotalCommentCountByGroupStatus.xml b/modules/comment/queries/getTotalCommentCountByGroupStatus.xml new file mode 100644 index 000000000..a93002dea --- /dev/null +++ b/modules/comment/queries/getTotalCommentCountByGroupStatus.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/comment/queries/getTotalCommentCountWithinMemberByGroupStatus.xml b/modules/comment/queries/getTotalCommentCountWithinMemberByGroupStatus.xml new file mode 100644 index 000000000..19b345da2 --- /dev/null +++ b/modules/comment/queries/getTotalCommentCountWithinMemberByGroupStatus.xml @@ -0,0 +1,28 @@ + + +
        +
        + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/comment/queries/getTotalCommentList.xml b/modules/comment/queries/getTotalCommentList.xml index 4f412ce0f..6c5da970b 100644 --- a/modules/comment/queries/getTotalCommentList.xml +++ b/modules/comment/queries/getTotalCommentList.xml @@ -8,6 +8,7 @@ + diff --git a/modules/comment/queries/getTotalCommentListWithinMember.xml b/modules/comment/queries/getTotalCommentListWithinMember.xml index 3ba8771a5..4bc79087f 100644 --- a/modules/comment/queries/getTotalCommentListWithinMember.xml +++ b/modules/comment/queries/getTotalCommentListWithinMember.xml @@ -9,6 +9,7 @@ + diff --git a/modules/comment/tpl/comment_list.html b/modules/comment/tpl/comment_list.html index 3963bf75b..cd80cc68d 100644 --- a/modules/comment/tpl/comment_list.html +++ b/modules/comment/tpl/comment_list.html @@ -1,81 +1,145 @@ - - - -
        -
        - - - -
        + +
        +
        +

        {$XE_VALIDATOR_MESSAGE}

        +
        + + + + +

        Comment

        +
        +
        + + + + + + + + + + + + + + + {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} + + + + + + + + + + + +
        All({number_format($total_count)}) All({number_format($total_count)}) + + | {$secret_name_list[$value->is_secret]}({$value->count}) + +
        {$lang->comment}{$lang->nick_name}{$lang->cmd_vote}(+/-){$lang->date}{$lang->ipaddress}{$lang->status}
        {$comment}{$lang->no_text_comment}{htmlspecialchars($val->nick_name)}0/0{(zdate($val->regdate,"Y-m-d\nH:i:s"))}{$val->ipaddress}{$secret_name_list['Y']}{$secret_name_list['N']}isCarted())-->checked="checked" />
        +
+ + + +
- - -
-

{$XE_VALIDATOR_MESSAGE}

-
-
- - - - - - - - - - - - - - - - - - - - - - - {@ $comment = cut_str(trim(htmlspecialchars(strip_tags($val->content))), 200, '...')} - - - - - - - - - - -
Total {number_format($total_count)}, Page {number_format($page)}/{number_format($total_page)}
{$lang->no}
{$lang->comment}
{$lang->nick_name}
{$lang->date}
{$lang->ipaddress}
{$no}{$comment}{$lang->no_text_comment}{htmlspecialchars($val->nick_name)}{(zdate($val->regdate,"Y-m-d\nH:i:s"))}{$val->ipaddress}
- -
- - - - diff --git a/modules/comment/tpl/js/comment_admin.js b/modules/comment/tpl/js/comment_admin.js index 7c964af60..0c6afb415 100644 --- a/modules/comment/tpl/js/comment_admin.js +++ b/modules/comment/tpl/js/comment_admin.js @@ -16,3 +16,47 @@ function doCancelDeclare() { function insertSelectedModule(id, module_srl, mid, browser_title) { location.href = current_url.setQuery('module_srl',module_srl); } + +function addCart(comment_srl) { + var params = new Array(); + var response_tags = ['error','message']; + var comment_srl = new Array(); + jQuery('#fo_list input[name=cart]:checked').each(function() { + comment_srl[comment_srl.length] = jQuery(this).val(); + }); + params['comment_srl'] = comment_srl.join(','); + + exec_xml('comment','procCommentAdminAddCart',params, completeAddCart, response_tags); +} + +function completeAddCart(ret_obj, response_tags) +{ +} + +function getCommentList() +{ + var params = new Array(); + var response_tags = ['error','message', 'comment_list']; + + exec_xml('comment','procCommentGetList',params, completeGetCommentList, response_tags); +} + +function completeGetCommentList(ret_obj, response_tags) +{ + var comment_list = ret_obj['comment_list']['item']; + console.log(comment_list); + /*var htmlListBuffer = ''; + var statusNameList = {"PUBLIC":"Public", "SECRET":"Secret", "PRIVATE":"Private", "TEMP":"Temp"}; + + for(var x in comment_list) + { + var objDocument = comment_list[x]; + htmlListBuffer += '' + + ''+ objDocument.variables.title +'' + + ''+ objDocument.variables.nick_name +'' + + ''+ statusNameList[objDocument.variables.status] +'' + + '' + + ''; + } + jQuery('#documentManageListTable>tbody').html(htmlListBuffer);*/ +} diff --git a/modules/document/conf/module.xml b/modules/document/conf/module.xml index 0f8e88f4e..449b989dc 100644 --- a/modules/document/conf/module.xml +++ b/modules/document/conf/module.xml @@ -45,6 +45,7 @@ + diff --git a/modules/document/document.admin.view.php b/modules/document/document.admin.view.php index 11475e695..37539e3f7 100644 --- a/modules/document/document.admin.view.php +++ b/modules/document/document.admin.view.php @@ -43,6 +43,9 @@ $oDocumentModel = &getModel('document'); $output = $oDocumentModel->getDocumentList($args); + // count eache status, not in trash... + $countOutput = $oDocumentModel->getDocumentCountByGroupStatus($args);; + // get Status name list $statusNameList = $oDocumentModel->getStatusNameList(); @@ -53,6 +56,7 @@ Context::set('document_list', $output->data); Context::set('status_name_list', $statusNameList); Context::set('page_navigation', $output->page_navigation); + Context::set('countOutput', $countOutput); // set a search option used in the template $count_search_option = count($this->search_option); diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index c66ed8f43..5706fb6bb 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -1693,6 +1693,28 @@ class documentController extends document { $this->add('document_srl', $obj->document_srl); } + /** + * @brief return Document List for exec_xml + **/ + function procDocumentGetList() + { + if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted'); + // Taken from a list of selected sessions + $flagList = $_SESSION['document_management']; + if(count($flagList)) { + foreach($flagList as $key => $val) { + if(!is_bool($val)) continue; + $documentSrlList[] = $key; + } + } + + if(count($documentSrlList)) { + $oDocumentModel = &getModel('document'); + $documentList = $oDocumentModel->getDocuments($documentSrlList, $this->grant->is_admin); + } + $this->add('document_list', $documentList); + } + /** * @brief for old version, comment allow status check. **/ diff --git a/modules/document/document.model.php b/modules/document/document.model.php index e538ab82e..e3edbc7bc 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -515,6 +515,26 @@ $total_count = $output->data->count; return (int)$total_count; } + + /** + * @brief module_srl the total number of documents that are bringing + **/ + function getDocumentCountByGroupStatus($search_obj = NULL) { + // Additional search options + $args->module_srl = $search_obj->module_srl; + $args->s_title = $search_obj->s_title; + $args->s_content = $search_obj->s_content; + $args->s_user_name = $search_obj->s_user_name; + $args->s_member_srl = $search_obj->s_member_srl; + $args->s_ipaddress = $search_obj->s_ipaddress; + $args->s_regdate = $search_obj->s_regdate; + $args->category_srl = $search_obj->category_srl; + + $output = executeQuery('document.getDocumentCountByGroupStatus', $args); + if(!$output->toBool()) return array(); + + return $output->data; + } /** * @brief Import page of the document, module_srl Without throughout .. **/ diff --git a/modules/document/queries/getDocumentCount.xml b/modules/document/queries/getDocumentCount.xml index bfd58f7aa..96995d139 100644 --- a/modules/document/queries/getDocumentCount.xml +++ b/modules/document/queries/getDocumentCount.xml @@ -7,14 +7,33 @@ + + + + + + + + + - + + + + + + + + + + + diff --git a/modules/document/queries/getDocumentCountByGroupStatus.xml b/modules/document/queries/getDocumentCountByGroupStatus.xml new file mode 100644 index 000000000..06cbb77ff --- /dev/null +++ b/modules/document/queries/getDocumentCountByGroupStatus.xml @@ -0,0 +1,43 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html index db43bee7d..a311969c2 100644 --- a/modules/document/tpl/document_list.html +++ b/modules/document/tpl/document_list.html @@ -1,9 +1,14 @@ - + +

Document

-
- +
All({number_format($total_count)}) All({number_format($total_count)}) | Public(456) | Secret(8) | Private(9) | Temp(12) | Trash(4)
+ @@ -13,7 +18,7 @@ - + @@ -29,57 +34,35 @@ - - - - - - - - - -
All({number_format($total_count)}) All({number_format($total_count)}) + + | {$status_name_list[$value->status]}({$value->count}) + +
{$lang->title}{$lang->date} {$lang->ipaddress} {$lang->status}
isCarted())-->checked="checked" />
The quick brown fox jumps over the lazy dog.홍길동21/-12010-12-24 15:59123.456.789.0Trash
- 선택한 글 관리... + 선택한 글 관리...