diff --git a/upload/configs/functions.php b/upload/configs/functions.php index 3552b7b..ac25a65 100644 --- a/upload/configs/functions.php +++ b/upload/configs/functions.php @@ -1,8 +1,8 @@ true, - "breadcrumbs" => true, + 'advice' => true, + 'breadcrumbs' => true, + 'close' => false, + 'close_time' => 0, ); - ?> \ No newline at end of file diff --git a/upload/engine/core.class.php b/upload/engine/core.class.php index c0d760e..f7dbfea 100644 --- a/upload/engine/core.class.php +++ b/upload/engine/core.class.php @@ -11,7 +11,7 @@ public $db, $user, $config = false; - public $lng, $lng_m, $lng_b = array(); + public $lng, $lng_m, $lng_b, $cfg_m = array(); public $csrf_time = 3600; @@ -433,6 +433,8 @@ $this->lng_m = $this->load_language($mode); + $this->cfg_m = $cfg; + $module = new module($this); @$module->cfg = $cfg; @@ -513,6 +515,8 @@ $this->lng_m = $lng; + $this->cfg_m = $cfg; + $module = new module($this); $module->cfg = $cfg; diff --git a/upload/index.php b/upload/index.php index 7c2c6dd..1e2e01c 100644 --- a/upload/index.php +++ b/upload/index.php @@ -10,6 +10,12 @@ if($core->config->main['install']){ $core->notify($core->lng['e_attention'], $core->lng['e_install'], 4, 'install/'); } +if($core->config->func['close'] && !$core->is_access('sys_adm_main')){ + if($core->config->func['close_time']<=0 || $core->config->func['close_time']>time()){ + $mode = ($mode=='auth') ? 'auth' : 'close'; + } +} + switch($mode){ case 'news': case 'search': @@ -19,7 +25,8 @@ case 'file': case 'restore': case 'ajax': - case 'statics': + case 'statics': + case 'close': $content = $core->load_def_mode($mode); break; diff --git a/upload/language/ru_RU/admin.php b/upload/language/ru_RU/admin.php index 586139f..e414637 100644 --- a/upload/language/ru_RU/admin.php +++ b/upload/language/ru_RU/admin.php @@ -484,6 +484,9 @@ 'set_base_type_mysqli' => 'MySQLi (Рекомендуется)', 'set_base_type_pdo' => 'PDO (Не поддерживается)', 'set_func_advice' => 'Выводить советы', + 'set_funt_bc' => 'Выводить хлебные крошки', + 'set_funt_close' => 'Технические работы', + 'set_funt_close_time' => 'Время до конца тех. работ', 'set_mail_from' => 'От кого', 'set_mail_from_ph' => 'От кого было отправлено сообщение', 'set_mail_from_name' => 'Имя отправителя', diff --git a/upload/language/ru_RU/close.php b/upload/language/ru_RU/close.php new file mode 100644 index 0000000..71063fd --- /dev/null +++ b/upload/language/ru_RU/close.php @@ -0,0 +1,12 @@ + 'Технические работы', + 'enter' => 'Войти', + 'auth' => 'Авторизация', + 'remember' => 'Запомнить меня', + 'time_for1' => 'Доступ на сайт закрыт на неопределенный срок', + 'time_for2' => 'Доступ на сайт закрыт до', +); + +?> \ No newline at end of file diff --git a/upload/modules/admin/settings.class.php b/upload/modules/admin/settings.class.php index e33f716..8a4f334 100644 --- a/upload/modules/admin/settings.class.php +++ b/upload/modules/admin/settings.class.php @@ -308,6 +308,8 @@ private function functions(){ + $this->core->header .= $this->core->sp(MCR_THEME_MOD."admin/settings/header.html"); + $cfg = $this->config->func; if($_SERVER['REQUEST_METHOD']=='POST'){ @@ -316,6 +318,10 @@ $cfg['breadcrumbs'] = (intval(@$_POST['breadcrumbs'])===1) ? true : false; + $cfg['close'] = (intval(@$_POST['close'])===1) ? true : false; + + $cfg['close_time'] = (@$_POST['close_time']=='') ? 0 : intval(strtotime(@$_POST['close_time'])); + if(!$this->config->savecfg($cfg, 'functions.php', 'func')){ $this->core->notify($this->core->lng["e_msg"], $this->lng['set_e_cfg_save'], 2, '?mode=admin&do=settings&op=functions'); } // Последнее обновление пользователя @@ -330,6 +336,8 @@ $data = array( "ADVICE" => ($cfg['advice']) ? 'selected' : '', "BREADCRUMBS" => ($cfg['breadcrumbs']) ? 'selected' : '', + "CLOSE" => ($cfg['close']) ? 'selected' : '', + 'CLOSE_TIME' => (intval($cfg['close_time'])<=0) ? '' : date("d.m.Y H:i:s", $cfg['close_time']), ); return $this->core->sp(MCR_THEME_MOD."admin/settings/functions.html", $data); diff --git a/upload/modules/close.php b/upload/modules/close.php new file mode 100644 index 0000000..2988bd9 --- /dev/null +++ b/upload/modules/close.php @@ -0,0 +1,45 @@ +core = $core; + $this->db = $core->db; + $this->config = $core->config; + $this->user = $core->user; + $this->lng = $core->lng_m; + + $bc = array( + $this->lng['mod_name'] => BASE_URL."?mode=close" + ); + + $this->core->bc = $this->core->gen_bc($bc); + } + + public function content(){ + + if(!$this->config->func['close']){ $this->core->notify(); } + + $time = time(); + + if($this->config->func['close_time']<=0){ + $for_time = $this->lng['time_for1']; + }else{ + $for_time = $this->lng['time_for2'].' '.date('H:i:s - d.m.Y', $this->config->func['close_time']); + } + + $data = array( + 'FOR_TIME' => $for_time, + ); + + echo $this->core->sp(MCR_THEME_MOD."close/main.html", $data); + + exit; + } +} + +?> \ No newline at end of file diff --git a/upload/modules/logout.php b/upload/modules/logout.php index 5c35da7..fb597c0 100644 --- a/upload/modules/logout.php +++ b/upload/modules/logout.php @@ -42,7 +42,7 @@ setcookie("mcr_user", "", time()-3600, '/'); - $this->core->notify('', $this->lng['e_success'], 1); + $this->core->notify('', '', 1); } } diff --git a/upload/system.php b/upload/system.php index 5a627b1..f01fc46 100644 --- a/upload/system.php +++ b/upload/system.php @@ -8,7 +8,7 @@ // System constants define('PROGNAME', 'WebMCR Reloaded'. MCR); -define('VERSION', 'WebMCR Beta 1.3.4'); +define('VERSION', 'WebMCR Beta 1.3.5'); define('FEEDBACK', ''.PROGNAME.' © 2013-'.date("Y").' Qexy'); define('MCR_ROOT', dirname(__FILE__).'/'); define('MCR_MODE_PATH', MCR_ROOT.'modules/'); diff --git a/upload/themes/default/modules/admin/settings/functions.html b/upload/themes/default/modules/admin/settings/functions.html index d14466f..e9db656 100644 --- a/upload/themes/default/modules/admin/settings/functions.html +++ b/upload/themes/default/modules/admin/settings/functions.html @@ -33,16 +33,33 @@
- +
+ +
+ +
+
+ +
+ +
+ +
+
+ +
@@ -54,4 +71,13 @@
- \ No newline at end of file + + + \ No newline at end of file diff --git a/upload/themes/default/modules/admin/settings/header.html b/upload/themes/default/modules/admin/settings/header.html new file mode 100644 index 0000000..dbc29b2 --- /dev/null +++ b/upload/themes/default/modules/admin/settings/header.html @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/upload/themes/default/modules/close/main.html b/upload/themes/default/modules/close/main.html new file mode 100644 index 0000000..4a69b0d --- /dev/null +++ b/upload/themes/default/modules/close/main.html @@ -0,0 +1,91 @@ + + + + <?php echo $this->config->main['s_name']; ?> — Тех. работы + + + + + + + + def_header; ?> + header; ?> + + + + +
+
+
+
+
+

config->main['s_name']; ?>

+

На сайте ведутся технические работы. Вход только для администрации.

+
+
+
+
+
+ +advice(); ?> + +
+
+
+ + +
+ +
+ +
lng_m['auth']; ?>
+ +
+ +
+
+

+
+
+ + +
+ +
+ + +
+ + + +
+ +
+
+
+ +
+ +
+ +
+
+
+ +
Loading...
+ + + + + + \ No newline at end of file