' . PHP_EOL;
+
+ $out .= '
' . PHP_EOL;
+ $out .= 'ENV:';
+ $out .= self::getStatistic('env');
+ $out .= '
' . PHP_EOL;
$out .= self::getStatistic('globals');
$out .= '
' . PHP_EOL;
+ $out .= '
' . PHP_EOL;
$out .= $AVE_DB->DBProfilesGet('list');
$out .= '
';
$out .= PHP_EOL;
- $out .= '
' . PHP_EOL;
+ $out .= '
' . PHP_EOL;
$out .= $AVE_DB->showAllQueries();
$out .= '
';
+ $out .= PHP_EOL;
+ $out .= '
' . PHP_EOL;
+ $out .= implode('', self::$_debug);
+ $out .= '
';
+
$out .= PHP_EOL;
$out .= '
';
diff --git a/class/class.docs.php b/class/class.docs.php
index 29611ec..1864400 100755
--- a/class/class.docs.php
+++ b/class/class.docs.php
@@ -1234,7 +1234,6 @@
*
* @return int|bool Возвращает номер документа если все удачно или false если все плохо
*/
-
function documentSave ($rubric_id, $document_id, $data, $update_non_exists_fields = false, $rubric_code = true, $revisions = true, $logs = true, $generate = true)
{
global $AVE_DB, $AVE_Template;
@@ -1262,8 +1261,19 @@
// Забираем параметры рубрики
$_rubric = $this->_get_rubric($rubric_id);
- // Запускаем триггер перед сохранением
- Hooks::trigger('DocumentBeforeSave', array('rubric_id' => $rubric_id, 'document_id' => $document_id, 'data' => $data, 'requests' => $_REQUEST));
+ $_data = [
+ 'rubric_id' => $rubric_id,
+ 'document_id' => $document_id,
+ 'data' => $data,
+ 'requests' => $_REQUEST
+ ];
+
+ Hooks::register('DocumentBeforeSave', 'DocumentBeforeSave', 100);
+
+ // Запускаем триггер перед сохранением, возвращаем $data для дальнейшего сохранения
+ $data = Hooks::trigger('DocumentBeforeSave', $_data);
+
+ unset ($_data);
// Выполняем стартовый код рубрики
if ($rubric_code)
@@ -1816,8 +1826,19 @@
? $data['field_module']
: '';
+ Hooks::register('DocumentAfterSave', 'DocumentAfterSave', 100);
+
+ $_data = [
+ 'rubric_id' => $rubric_id,
+ 'document_id' => $document_id,
+ 'data' => $data,
+ 'field_module' => $field_module
+ ];
+
// Запускаем триггер после сохранения
- Hooks::trigger('DocumentAfterSave', array('rubric_id' => $rubric_id, 'document_id' => $document_id, 'data' => $data, 'field_module' => $field_module));
+ Hooks::trigger('DocumentAfterSave', $_data);
+
+ unset ($_data);
// Выполняем код рубрики, после сохранения
if ($rubric_code)
@@ -1845,6 +1866,7 @@
return $document_id;
}
+
/**
* Метод, предназначенный для добавления нового документа в БД
*
@@ -4419,5 +4441,17 @@
exit;
}
+
+
+ function DocumentBeforeSave ($data)
+ {
+ return $data['data'];
+ }
+
+
+ function DocumentAfterSave ($data)
+ {
+ return $data;
+ }
}
?>
\ No newline at end of file
diff --git a/inc/config.php b/inc/config.php
index 8ef63e8..cac706b 100755
--- a/inc/config.php
+++ b/inc/config.php
@@ -12,7 +12,7 @@
*/
@define('APP_NAME', 'AVE.cms');
- @define('APP_VERSION', '3.26');
+ @define('APP_VERSION', '3.25');
@define('APP_INFO', '
Ave-Cms.Ru '.'© 2007-' . date('Y'));
$themes = array();
@@ -280,6 +280,14 @@
'VARIANT' => array('off', 'light', 'full')
);
+ //-- Вывод общей статистики
+ $GLOBALS['CMS_CONFIG']['_CONST_DEV']['PROFILING_ADMIN'] = array(
+ 'DESCR' => 'Вывод общей статистики в дминистративной части',
+ 'DEFAULT' => false,
+ 'TYPE' => 'bool',
+ 'VARIANT' => ''
+ );
+
//-- Собирать статистику выполненных запросов
$GLOBALS['CMS_CONFIG']['_CONST_DEV']['SQL_PROFILING'] = array(
'DESCR' => 'Собирать статистику выполненных SQL запросов',
diff --git a/lib/debug/debug.css b/lib/debug/debug.css
index 874272a..2956370 100644
--- a/lib/debug/debug.css
+++ b/lib/debug/debug.css
@@ -1,51 +1,123 @@
-/* == Debug Panel == */
-#debug-panel {
- font-size: 12px !important;
- opacity: 0.9;
+#debug_btn {
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABGdBTUEAAK/INwWK6QAAABl0RVh0U29mdHdhcmUAQWRvYmUgSW1hZ2VSZWFkeXHJZTwAAAKYSURBVDjLnZPJT1NRFMb5G1wDHV5boNiqdHrvFYolCAtsGSSWKpMFKhYqlDI6oAEKaVJwCIgSphaKtLYWCgSNBgRjMNHoxsSFS3cmJmA0NMTw+R6JKKZl4eJL7sm953fOd3JPHIC4WMpcppG5SGnZc8ZjVVF6QLn975sDgfaZmvg71oRJZIRUYcuAnq/2KWroGfm3QwEn2YpLVPPvOD2oiqj9yq/mGznegl56mx6T7ZbY1M6YAM0CuZkxT0b2Wg6QW/SsApRXDsotR+d6E9Y/h9DuqoCuJq0lKoDxqU1/pITGR27mBU4h+GEcTz5OY+ClA5JbyahYzof/9TBO9B/FcWcqpA4xU3We3GJ87ntnfO5meinMvruNnqcmXA2XoDVcCc0wCYkzBaZpA7ILRJ/2O2B87jA+QT9UeDRe8svZYAG8b/txc6kc9mA+yqayYPQXwvdmBEOrA5B2p0BtFIYOWKCm5RukWwZyXIbA+0F0LpaiKaBHmVsLw4we99ccsM8a8GClF5JOMcQdou8prULrgRmQo7KI0VcE13MrGv06lE5kodhzGvdWu2GdKkTVWC4DcELcJkKyXbCb1EhAVM//M0DVUNqP2qAJd1baUDaZjTMTeXAttsPi0cM0mgvHvA0NkxYk2QRIrieOsDmEmXttH0DfVfSluSToWmpD8bgOroUOWNw6VI7koGfOBuq6EqLLTNU6ojrmP5D1HVsjmrkYezGIrlA9LjKgnrlGXJlpgbCOD0EtD0QNN8I3cZqjAlhJr4rXpB1iNLhrYffUQWoT7yUKzbxqJlHLq0jc5JYmgHMunogKYJVqF7mTrPyfgktMRTMX/CrOq1gLF3fYNrLiX+Bs8MoTwT2fQPwXgBXHGL+TaIjfinb3C7cscRMIcYL6AAAAAElFTkSuQmCC);
+ cursor: pointer;
position: fixed;
- bottom: 0;
+ top: 4px;
+ right: 4px;
+ width: 16px;
+ height: 16px;
+ z-index: 99999999;
+}
+
+#debug_bar {
+ background: #ffffff;
+ color: #000000;
+ display: none;
+ font-family: "Consolas", Verdana, Arial;
+ font-size: 11pt;
+ font-weight: normal;
+ line-height: normal;
+ position: fixed;
+ top: 0;
left: 0;
- z-index: 2000;
width: 100%;
- font-family: Consolas, Monaco, Menlo, "Courier New", monospace !important;
-}
-#debug-panel .debug-wrapper {
- padding: 0px .875em;
- background-color: #fff;
- border: 1px solid rgba(0,0,0,0.2);
- border-bottom: 0;
- margin: 0px auto 0px auto;
-}
-#debug-panel .items {
- padding: 10px;
- height: 350px;
- padding-top: 1em;
- font-size: 12px !important;
- color: #888;
- font-family: Consolas, Monaco, Menlo, "Courier New", monospace !important;
-}
-#debug-panel .debug-wrapper .legend {
- background-color: #f9f9f9;
- padding: .25em;
- border: 1px solid rgba(0,0,0,0.2);
- width: auto;
- margin-top: -1.25em;
-}
-#debug-panel .debug-wrapper .legend span {
- color: #999;
- font-weight: 300 !important
-}
-#debug-panel a {
- text-decoration: none;
- color: rgba(0,0,0,0.5);
+ height: 100%;
+ z-index: 90000000;
+}
+
+#debug_bar .debug_tabs {
+ display: block;
+ list-style: none;
+ margin: 0;
+ padding: 0;
+ border-bottom: 1px solid #999999;
+ overflow: hidden;
+}
+
+#debug_bar .debug_tabs > li {
+ cursor: pointer;
+ font-family: Tahoma;
+ font-size: 10px;
+ font-weight: bold;
+ color: #000000;
+ display: block;
+ float: left;
+ line-height: 18px;
+ padding: 3px 5px;
+ border-right: 1px solid #999999;
+}
+
+#debug_bar .debug_tabs > li:hover {
+ background: #ff8000;
+}
+
+#debug_bar .debug_tabs > li.selected {
+ background: #999999;
+ border-bottom: 3px solid #999999;
+ margin-bottom: -3px;
+ color: #ffffff;
+}
+
+#debug_bar .debug_tab {
+ font-family: "Consolas", Verdana, Arial;
font-size: 12px;
- margin: 0 .25em;
+ clear: both;
+ display: none;
+ padding: 15px;
+ overflow: scroll;
+ position: absolute;
+ left: 0;
+ right: 0;
+ top: 25px;
+ bottom: 0;
+}
+
+#debug_bar pre,
+#debug_bar code {
+ display: block;
+ margin: 0;
+ color: #000;
+ background: #FFF;
+ font-size: 12px;
+ border: 0;
+ padding: 5px 10px;
+ overflow-y: auto;
+ max-height: calc(100vh - 30px);
+ max-width: 100%;
+ overflow-x: hidden;
+}
+
+#debug_bar pre.pre_wrap,
+#debug_bar code.pre_wrap {
+ white-space: pre-wrap; /* Since CSS 2.1 */
+ white-space: -moz-pre-wrap; /* Mozilla, since 1999 */
+ white-space: -pre-wrap; /* Opera 4-6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ word-wrap: break-word; /* Internet Explorer 5.5+ */
+ word-break: break-all;
+}
+
+#debug_bar .debug_one_query {
+ padding: 2px 0px;
+}
+
+#debug_bar .debug_one_query span {
+ display: inline-block;
+ vertical-align: middle;
+ width: calc(100% - 64px);
+}
+
+#debug_bar .debug_one_query span:first-child {
+ width: 64px;
}
-#debug-panel pre {
- border: 0px;
- font-family: Consolas, Monaco, Menlo, "Courier New", monospace !important;
- font-size: 12px !important;
+
+#debug_bar .debug_one_dump {
+ padding:0 0 40px 0;
}
-#debugArrowMinimize {
- float: right;
+
+#debug_bar .debug_one_dump .debug_varname {
+ display:block;
+ font-weight:bold;
+ font-size: 16px;
+ text-transform: uppercase;
}
\ No newline at end of file
diff --git a/lib/debug/debug.js b/lib/debug/debug.js
index 155958e..44d9389 100644
--- a/lib/debug/debug.js
+++ b/lib/debug/debug.js
@@ -1,30 +1,35 @@
-function appExpandTabs(act, key) {
- var arrDebugTabs = ["General", "Params", "Globals", "Queries", "SqlTrace"];
+$(document).ready(function() {
- keyTab = (key == null)
- ? "General"
- : key;
+ $('#debug_btn').on('click', function() {
- for (var i = 0; i < arrDebugTabs.length; i++) {
- if (act == "min" || arrDebugTabs[i] != keyTab) {
- $("#content" + arrDebugTabs[i]).css("display", "none");
- $("#tab" + arrDebugTabs[i]).css("color", "#bbb")
+ $bar = $('#debug_bar');
+
+ if ($bar.css('display') == 'none') {
+ $(document.body).css('overflow', 'hidden');
+ $bar.show();
+ } else {
+ $(document.body).css('overflow', '');
+ $bar.hide();
}
- }
- if (act != "min") {
- $("#content" + keyTab).css("display", "");
- $("#content" + keyTab).css({
- "overflow-y": "auto"
- });
- $("#tab" + keyTab).css("color", "#222")
- }
- $("#debug-panel").css("opacity", (act == "min") ? "0.9" : "1");
-};
+ });
+ $('.debug_tabs > li').on('click', function() {
+ $('.debug_tabs > li').removeClass('selected');
+ $('.debug_tab').hide();
+ $(this).addClass('selected');
+ $('#'+this.id+'-cont').show();
+ if($.cookie){
+ $.cookie('__debug_bar', this.id, {expires: 7, path: '/'});
+ }
+ });
+
+ if($.cookie){
+ var id = $.cookie('__debug_bar');
+ var tab = $('.debug_tabs > li#'+id);
+ if(tab.length > 0){
+ tab.click();
+ }
+ }
-function appTabsHide()
-{
- $('#debug-panel-legend span a').css("color", "#bbb");
- $("#debug-panel .items").hide();
-}
\ No newline at end of file
+}); //document.ready
\ No newline at end of file