mirror of
https://github.com/avecms/AVE.cms.git
synced 2025-01-22 07:20:07 +00:00
Fixes
This commit is contained in:
parent
4fc6b9f35c
commit
0ee7891d41
@ -30,11 +30,10 @@
|
||||
|
||||
<!-- JS Scripts -->
|
||||
<script>
|
||||
var ave_path = "{$ABS_PATH}";
|
||||
var ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}";
|
||||
var ave_admintpl = "{$tpl_dir}";
|
||||
|
||||
var sess = '{$sess}';
|
||||
var ave_path = "{$ABS_PATH}",
|
||||
ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}",
|
||||
ave_admintpl = "{$tpl_dir}",
|
||||
sess = '{$sess}';
|
||||
</script>
|
||||
|
||||
<script type="text/javascript" language="JavaScript">
|
||||
|
@ -1,44 +1,43 @@
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
||||
<title>{#MAIN_PAGE_TITLE#} - {*#SUB_TITLE#*} ({$smarty.session.user_name|escape})</title>
|
||||
|
||||
<title>{#MAIN_PAGE_TITLE#} - {*#SUB_TITLE#*} ({$smarty.session.user_name|escape})</title>
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta name="generator" content="Notepad" >
|
||||
<meta name="Expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
|
||||
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<meta http-equiv="pragma" content="no-cache">
|
||||
<meta name="generator" content="Notepad" >
|
||||
<meta name="Expires" content="Mon, 06 Jan 1990 00:00:01 GMT">
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="{$ABS_PATH}admin/admin.favicon.ico">
|
||||
<link rel="SHORTCUT ICON" href="{$ABS_PATH}admin/admin.favicon.ico">
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/vnd.microsoft.icon" href="{$ABS_PATH}admin/admin.favicon.ico">
|
||||
<link rel="SHORTCUT ICON" href="{$ABS_PATH}admin/admin.favicon.ico">
|
||||
<!-- CSS Files -->
|
||||
<link href="{$tpl_dir}/css/reset.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/main.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/data_table.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/jquery-ui_custom.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/jquery.fancybox.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/color_{$smarty.const.DEFAULT_THEME_FOLDER_COLOR}.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
|
||||
<!-- CSS Files -->
|
||||
<link href="{$tpl_dir}/css/reset.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/main.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/data_table.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/jquery-ui_custom.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/jquery.fancybox.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<link href="{$tpl_dir}/css/color_{$smarty.const.DEFAULT_THEME_FOLDER_COLOR}.css" rel="stylesheet" type="text/css" media="screen" />
|
||||
<!-- JS files -->
|
||||
{include file='scripts.tpl'}
|
||||
|
||||
<!-- JS files -->
|
||||
{include file='scripts.tpl'}
|
||||
<script type="text/javascript" src="/admin/lang/{$smarty.session.admin_language}/scripts.js"></script>
|
||||
<script src="{$tpl_dir}/js/main.js" type="text/javascript"></script>
|
||||
|
||||
<script type="text/javascript" src="/admin/lang/{$smarty.session.admin_language}/scripts.js"></script>
|
||||
<script src="{$tpl_dir}/js/main.js" type="text/javascript"></script>
|
||||
<!-- JS Scripts -->
|
||||
<script>
|
||||
var ave_path = "{$ABS_PATH}",
|
||||
ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}",
|
||||
ave_admintpl = "{$tpl_dir}",
|
||||
sess = "{$sess}";
|
||||
</script>
|
||||
|
||||
<!-- JS Scripts -->
|
||||
<script>
|
||||
var ave_path = "{$ABS_PATH}";
|
||||
var ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}";
|
||||
var ave_admintpl = "{$tpl_dir}";
|
||||
var sess = "{$sess}";
|
||||
</script>
|
||||
|
||||
</head>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Wrapper -->
|
||||
<div class="wrapper">
|
||||
|
163
class/class.errors.php
Normal file
163
class/class.errors.php
Normal file
@ -0,0 +1,163 @@
|
||||
<?php
|
||||
|
||||
// Проверка
|
||||
if (! defined('BASE_DIR'))
|
||||
exit('Access denied');
|
||||
|
||||
/**
|
||||
* This source file is part of the AVE.cms. More information,
|
||||
* documentation and tutorials can be found at http://www.ave-cms.ru
|
||||
*
|
||||
* @package AVE.cms
|
||||
* @file system/helpers/errors.php
|
||||
* @author @
|
||||
* @copyright 2007-2016 (c) AVE.cms
|
||||
* @link http://www.ave-cms.ru
|
||||
* @version 4.0
|
||||
* @since $date$
|
||||
* @license license GPL v.2 http://www.ave-cms.ru/license.txt
|
||||
*/
|
||||
|
||||
class Errors
|
||||
{
|
||||
/**
|
||||
* Errors constructor.
|
||||
*/
|
||||
public function __construct ()
|
||||
{
|
||||
set_error_handler([$this, 'scriptError']);
|
||||
register_shutdown_function([$this, 'shutDown']);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param $errno
|
||||
* @param $errstr
|
||||
* @param $errfile
|
||||
* @param $errline
|
||||
*/
|
||||
public function scriptError ($errno, $errstr, $errfile, $errline)
|
||||
{
|
||||
switch($errno)
|
||||
{
|
||||
case E_ERROR:
|
||||
$errseverity = 'Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_WARNING:
|
||||
$errseverity = 'Warning';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
case E_NOTICE:
|
||||
$errseverity = 'Notice';
|
||||
$color = '#23b7e5';
|
||||
break;
|
||||
|
||||
case E_CORE_ERROR:
|
||||
$errseverity = 'Core Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_CORE_WARNING:
|
||||
$errseverity = 'Core Warning';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
case E_COMPILE_ERROR:
|
||||
$errseverity = 'Compile Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_COMPILE_WARNING:
|
||||
$errseverity = 'Compile Warning';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
case E_USER_ERROR:
|
||||
$errseverity = 'User Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_USER_WARNING:
|
||||
$errseverity = 'User Warning';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
case E_USER_NOTICE:
|
||||
$errseverity = 'User Notice';
|
||||
$color = '#23b7e5';
|
||||
break;
|
||||
|
||||
case E_STRICT:
|
||||
$errseverity = 'Strict Standards';
|
||||
$color = '#edf1f2';
|
||||
break;
|
||||
|
||||
case E_PARSE:
|
||||
$errseverity = 'Parse Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_RECOVERABLE_ERROR:
|
||||
$errseverity = 'Recoverable Error';
|
||||
$color = '#f05050';
|
||||
break;
|
||||
|
||||
case E_DEPRECATED:
|
||||
$errseverity = 'Deprecated';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
case E_USER_DEPRECATED:
|
||||
$errseverity = 'User Deprecated';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
|
||||
default:
|
||||
$errseverity = 'Error';
|
||||
$color = '#fad733';
|
||||
break;
|
||||
}
|
||||
|
||||
$out = '<div style="border: 1px solid ' . $color . '; margin: 10px; font-size: 11px; font-family: Consolas, Verdana, Arial; border-radius: 5px; box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.2);">';
|
||||
$out .= '<div style="background: ' . $color . '; color: #000; margin: 0; padding: 6px;">';
|
||||
$out .= '<strong>' . $errseverity . '</strong> Line <strong>' . $errline . '</strong>: ' . $errfile;
|
||||
$out .= '</div>';
|
||||
$out .= '<div style="background: #f0f0f0; color: #000; margin: 0; padding: 6px; text-shadow: 0 1px 1px rgba(0, 0, 0, 0.2);">';
|
||||
$out .= '['.$errno.'] '. $errstr;
|
||||
$out .= '</div>';
|
||||
$out .= '</div>';
|
||||
|
||||
echo $out;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function shutDown ()
|
||||
{
|
||||
if ($error = error_get_last())
|
||||
{
|
||||
if (! headers_sent())
|
||||
header('HTTP/1.1 500 Internal Server Error');
|
||||
|
||||
switch($error['type'])
|
||||
{
|
||||
case E_ERROR:
|
||||
case E_PARSE:
|
||||
case E_STRICT:
|
||||
case E_CORE_ERROR:
|
||||
case E_CORE_WARNING:
|
||||
case E_COMPILE_ERROR:
|
||||
case E_COMPILE_WARNING:
|
||||
case E_USER_ERROR:
|
||||
case E_RECOVERABLE_ERROR:
|
||||
$this->scriptError($error['type'], $error['message'], $error['file'], $error['line']);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
@ -29,7 +29,7 @@
|
||||
public static $run_hooks;
|
||||
|
||||
|
||||
public static function init()
|
||||
public static function init ()
|
||||
{
|
||||
if (!self::$instance) {
|
||||
self::$instance = new Hooks();
|
||||
@ -40,7 +40,7 @@
|
||||
/**
|
||||
* Add Hook
|
||||
*/
|
||||
public static function register($name, $function, $priority = 10)
|
||||
public static function register ($name, $function, $priority = 10)
|
||||
{
|
||||
// If we have already registered this action return true
|
||||
if (isset(self::$hooks[$name][$priority][$function]))
|
||||
@ -74,7 +74,7 @@
|
||||
/**
|
||||
* Do Hook
|
||||
*/
|
||||
public static function trigger($name, $arguments = "")
|
||||
public static function trigger ($name, $arguments = "")
|
||||
{
|
||||
// Oh, no you didn't. Are you trying to run an action hook that doesn't exist?
|
||||
if (! isset(self::$hooks[$name]))
|
||||
@ -115,7 +115,7 @@
|
||||
/**
|
||||
* Remove Hook
|
||||
*/
|
||||
public static function unregister($name, $function, $priority = 10)
|
||||
public static function unregister ($name, $function, $priority = 10)
|
||||
{
|
||||
// If the action hook doesn't, just return true
|
||||
if (!isset(self::$hooks[$name][$priority][$function]))
|
||||
@ -135,7 +135,7 @@
|
||||
* Get the currently running action hook
|
||||
*
|
||||
*/
|
||||
public static function current()
|
||||
public static function current ()
|
||||
{
|
||||
return self::$current_hook;
|
||||
}
|
||||
@ -144,7 +144,7 @@
|
||||
/**
|
||||
* Has Run
|
||||
*/
|
||||
public static function has($hook, $priority = 10)
|
||||
public static function has ($hook, $priority = 10)
|
||||
{
|
||||
if (isset(self::$hooks[$hook][$priority]))
|
||||
{
|
||||
@ -160,7 +160,7 @@
|
||||
/**
|
||||
* Hook Exists
|
||||
*/
|
||||
public static function exists($name)
|
||||
public static function exists ($name)
|
||||
{
|
||||
if (isset(self::$hooks[$name]))
|
||||
{
|
||||
|
@ -21,6 +21,8 @@
|
||||
|
||||
$lang_file = $fld_dir . 'lang/' . (defined('ACP') ? $_SESSION['admin_language'] : $_SESSION['user_language']) . '.txt';
|
||||
|
||||
$doc_id = isset($_REQUEST['Id']) ? (int)$_REQUEST['Id'] : '0';
|
||||
|
||||
$AVE_Template->config_load($lang_file, 'lang');
|
||||
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars());
|
||||
$AVE_Template->config_load($lang_file, 'admin');
|
||||
@ -32,7 +34,7 @@
|
||||
$AVE_Template->assign('field_value', $field_value);
|
||||
$AVE_Template->assign('doc_id', (int)$_REQUEST['Id']);
|
||||
$AVE_Template->assign('rubric_id', $rubric_id);
|
||||
$AVE_Template->assign('f_id', $field_id.'_'.(int)$_REQUEST['Id']);
|
||||
$AVE_Template->assign('f_id', $field_id . '_' . $doc_id);
|
||||
|
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'admin', $_tpl);
|
||||
|
||||
|
51
inc/init.php
51
inc/init.php
@ -21,8 +21,24 @@
|
||||
//-- Подключаем файл настроек
|
||||
require_once (BASE_DIR . '/inc/config.php');
|
||||
|
||||
if (PHP_DEBUGGING_FILE && ! defined('ACP'))
|
||||
include_once BASE_DIR . '/inc/errors.php';
|
||||
//-- Вкл/Выкл отображения ошибок php
|
||||
if (! PHP_DEBUGGING)
|
||||
{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set('display_errors', 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', false);
|
||||
}
|
||||
|
||||
|
||||
if (PHP_DEBUGGING_FILE && !defined('ACP'))
|
||||
{
|
||||
require(BASE_DIR . '/class/class.errors.php');
|
||||
new Errors();
|
||||
}
|
||||
|
||||
//-- Registry
|
||||
require(BASE_DIR . '/class/class.registry.php');
|
||||
@ -42,7 +58,7 @@
|
||||
if (! ini_get('register_globals'))
|
||||
return;
|
||||
|
||||
$allowed = array(
|
||||
$allowed =[
|
||||
'_ENV' => 1,
|
||||
'_GET' => 1,
|
||||
'_POST' => 1,
|
||||
@ -51,9 +67,9 @@
|
||||
'_SERVER' => 1,
|
||||
'_REQUEST' => 1,
|
||||
'GLOBALS' => 1
|
||||
);
|
||||
];
|
||||
|
||||
foreach ($GLOBALS as $key => $value)
|
||||
foreach ($GLOBALS AS $key => $value)
|
||||
{
|
||||
if (! isset($allowed[$key]))
|
||||
unset($GLOBALS[$key]);
|
||||
@ -92,16 +108,6 @@
|
||||
return $array;
|
||||
}
|
||||
|
||||
|
||||
if (! get_magic_quotes_gpc())
|
||||
{
|
||||
$_GET = add_slashes($_GET);
|
||||
$_POST = add_slashes($_POST);
|
||||
$_REQUEST = array_merge($_POST, $_GET);
|
||||
$_COOKIE = add_slashes($_COOKIE);
|
||||
}
|
||||
|
||||
|
||||
function isSSL()
|
||||
{
|
||||
if (isset($_SERVER['HTTPS']))
|
||||
@ -184,21 +190,6 @@
|
||||
//-- Переключение для нормальной работы с русскими буквами в некоторых функциях
|
||||
mb_internal_encoding("UTF-8");
|
||||
|
||||
//-- Вкл/Выкл отображения ошибок php
|
||||
if (! PHP_DEBUGGING_FILE)
|
||||
{
|
||||
if (! PHP_DEBUGGING)
|
||||
{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set('display_errors', 7);
|
||||
}
|
||||
else
|
||||
{
|
||||
error_reporting(E_ALL);
|
||||
ini_set('display_errors', 1);
|
||||
}
|
||||
}
|
||||
|
||||
//-- Подкючаем необходимые файлы функций
|
||||
require_once (BASE_DIR . '/functions/func.breadcrumbs.php'); // Хлебные крошки
|
||||
require_once (BASE_DIR . '/functions/func.common.php'); // Основные функции
|
||||
|
@ -37,7 +37,7 @@
|
||||
require_once (BASE_DIR . '/lib/mobile_detect/Mobile_Detect.php');
|
||||
$MobileDetect = new Mobile_Detect;
|
||||
|
||||
$init_start = microtime(true);
|
||||
$init_start = microtime();
|
||||
|
||||
//-- Подключаем файл инициализации
|
||||
require (BASE_DIR . '/inc/init.php');
|
||||
@ -57,6 +57,7 @@
|
||||
|
||||
//-- Подключаем ядро системы
|
||||
require (BASE_DIR . '/class/class.core.php');
|
||||
|
||||
$AVE_Core = new AVE_Core;
|
||||
|
||||
//-- Проверям на вызов внешних модулей и системных блоков
|
||||
@ -69,10 +70,10 @@
|
||||
)
|
||||
$AVE_Core->coreUrlParse($_SERVER['REQUEST_URI']);
|
||||
|
||||
$GLOBALS['page_id'] = array((isset($_REQUEST['id'])
|
||||
$GLOBALS['page_id'] = [(isset($_REQUEST['id'])
|
||||
? $_REQUEST['id']
|
||||
: '')
|
||||
=> ['page' => floatval(0)]);
|
||||
=> ['page' => floatval(0)]];
|
||||
|
||||
//-- Если пришел вызов на показ ревизии документа
|
||||
if (! empty($_REQUEST['revission']))
|
||||
@ -173,4 +174,4 @@
|
||||
$GLOBALS['block_generate']['DOCUMENT']['CONTENT'] = Debug::endTime('CONTENT');
|
||||
|
||||
//-- Вывод конечного результата
|
||||
output_compress($render);
|
||||
output_compress($render);
|
Loading…
x
Reference in New Issue
Block a user