diff --git a/modules/admin/tpl/css/admin.css b/modules/admin/tpl/css/admin.css
index 4227f5796..c435566d1 100644
--- a/modules/admin/tpl/css/admin.css
+++ b/modules/admin/tpl/css/admin.css
@@ -597,3 +597,9 @@ html[lang="mn"] .x .g11n.active>[disabled],
.modal .ie6{position:absolute;left:0;top:0;width:100%;height:100%;border:0;opacity:0;filter:alpha(opacity=0);z-index:1}
.modalClose{position:absolute;right:-8px;top:-8px;border:0;background:#ddd;padding:0;width:28px;height:28px;font-size:14px;font-weight:bold;cursor:pointer;color:#999;border-radius:5px}
.modalBlur{position:absolute;top:0;right:0;border:0;background:none;padding:0;width:1px;height:1px;overflow:hidden}
+
+.x_modal._common {width:600px;margin-left:-300px}
+.x_modal._common._small{width:400px;margin-left:-200px}
+.x_modal._common._nobody .x_modal-body,
+.x_modal._common._type_alert ._cancel{display:none}
+.x_modal._common._nobody .x_modal-footer{border-top:0}
\ No newline at end of file
diff --git a/modules/admin/tpl/js/admin.js b/modules/admin/tpl/js/admin.js
index 5785b00f6..306224ea6 100644
--- a/modules/admin/tpl/js/admin.js
+++ b/modules/admin/tpl/js/admin.js
@@ -922,6 +922,231 @@ jQuery(function($){
}
});
*/
+jQuery(function($){
+ var _hide = $.fn.hide;
+ $.fn.hide = function(htOpt) {
+ $(this).trigger('hide', [htOpt]);
+
+ return _hide.apply(this, arguments);
+ }
+
+ var _show = $.fn.show;
+ $.fn.show = function(htOpt) {
+ $(this).trigger('show', [htOpt]);
+
+ return _show.apply(this, arguments);
+ }
+});
+
+jQuery(function($){
+ /*
+
").addClass("x_modal _common x").css('display', 'none');
+ $msgBox.html('
\
+ \
+
\
+ ');
+
+ //console.log($msgBox.html());
+ $($.find("body")).append($msgBox);
+ //console.log($.find("body"));
+ //$msgBox.show();
+ /*
+
+ */
+
+ //var $msgBox = $("#msgBox");
+ $msgBox.find("._ok").click(function(){
+ $.xeMsgBox.fnOnOK();
+ });
+ $msgBox.find("._cancel").click(function(){
+ $.xeMsgBox.fnOnCancel();
+ });
+ $msgBox.bind("show", function(){
+ $.xeMsgBox.bVisible = true;
+ $.xeMsgBox._showFoggy();
+ $.xeMsgBox.fnOnShow();
+
+ if($msgBox.find('input').length > 0){
+ setTimeout(function(){
+ $msgBox.find('input').focus()
+ }, 0);
+ }
+ });
+ $msgBox.bind("hide", function(){
+ $.xeMsgBox.bVisible = false;
+ $.xeMsgBox._hideFoggy();
+ $.xeMsgBox.fnOnHide();
+ });
+ $(document.body).on('keydown', function(ev){
+ if(!$.xeMsgBox.bVisible) return;
+
+ if(ev.keyCode === 27){
+ $msgBox.find("._cancel").click();
+ }
+ });
+
+ $.xeMsgBox.fnOnOK = function(){
+ if(typeof $.xeMsgBox.htOptions.fnOnOK === "function"){
+ if($.xeMsgBox.htOptions.fnOnOK()) return;
+ }
+
+ $msgBox.hide();
+ };
+
+ $.xeMsgBox.fnOnCancel = function(){
+ if(typeof $.xeMsgBox.htOptions.fnOnCancel === "function") $.xeMsgBox.htOptions.fnOnCancel();
+
+ $msgBox.hide();
+ };
+
+ $.xeMsgBox.fnOnShow = function(){
+ if(typeof $.xeMsgBox.htOptions.fnOnShow === "function") $.xeMsgBox.htOptions.fnOnShow();
+ };
+
+ $.xeMsgBox.fnOnHide = function(){
+ if(typeof $.xeMsgBox.htOptions.fnOnHide === "function") $.xeMsgBox.htOptions.fnOnHide();
+ };
+
+
+ $.xeMsgBox.showMsgBox = function(htOptions){
+ // sTitle, sText, fnOnOK, fnOnCancel, bSmall, bAlert, fnOnShow, fnOnHide, bDanger
+ htOptions = $.xeMsgBox.htOptions = htOptions || {};
+
+ var sTitle = htOptions.sTitle || "";
+ var sText = htOptions.sText || "";
+
+ var bDanger = htOptions.bDanger || false;
+
+ $msgBox.find("._title") .html(sTitle);
+ $msgBox.find("._text").html(sText);
+
+ if(sText === ""){
+ $msgBox.addClass('_nobody');
+ }else{
+ $msgBox.removeClass('_nobody');
+ }
+
+ var $confirmBtn = $msgBox.find('._ok');
+ if(bDanger){
+ $confirmBtn.removeClass('x_btn-inverse');
+ $confirmBtn.addClass('x_btn-danger');
+ }else{
+ $confirmBtn.removeClass('x_btn-danger');
+ $confirmBtn.addClass('x_btn-inverse');
+ }
+
+ // #msgBox._small {width:400px;margin-left:-200px}
+ // #msgBox._type_alert _cancel{display:none}
+ if(htOptions.bSmall){
+ $msgBox.addClass("_small");
+ }else{
+ $msgBox.removeClass("_small");
+ }
+
+ if(htOptions.bAlert){
+ $msgBox.addClass("_type_alert");
+ }else{
+ $msgBox.removeClass("_type_alert");
+ }
+
+ $msgBox.show();
+ }
+ $.xeMsgBox.alertDialog = function(htOptions){
+ htOptions = htOptions || {};
+ htOptions.bAlert = true;
+
+ this.showMsgBox(htOptions);
+ }
+ $.xeMsgBox.confirmDialog = function(htOptions){
+ htOptions = htOptions || {};
+ htOptions.bAlert = false;
+
+ this.showMsgBox(htOptions);
+ }
+
+ var $foggyLayer = $.xeMsgBox.$foggyLayer = $("
");
+ $foggyLayer.css({
+ position: 'absolute',
+ top:0,
+ left:0,
+ backgroundColor:'#000',
+ opacity: 0.5,
+ display:'none',
+ zIndex:100
+ });
+ //$($.find("body")).append($msgBox);
+ $($.find("body")).append($foggyLayer);
+
+ $.xeMsgBox._resizeFoggy = function(){
+ $foggyLayer.css({
+ width: 0,
+ height: 0
+ });
+
+ setTimeout(function(){
+ $foggyLayer.css({
+ width: $(document).width(),
+ height: $(document).height()
+ });
+ }, 0);
+ }
+ $(window).resize($.xeMsgBox._resizeFoggy);
+ $.xeMsgBox._resizeFoggy();
+
+ $.xeMsgBox._showFoggy = function(){
+ $foggyLayer.show();
+ }
+ $.xeMsgBox._hideFoggy = function(){
+ $foggyLayer.hide();
+ }
+
+
+});
+
// Sortable table
jQuery(function($){
var
diff --git a/modules/document/tpl/document_list.html b/modules/document/tpl/document_list.html
index ce19fd5a2..654fc86b5 100644
--- a/modules/document/tpl/document_list.html
+++ b/modules/document/tpl/document_list.html
@@ -154,7 +154,286 @@ xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
+