Browse Source

Fixes

master
M@dD3n 5 years ago
parent
commit
e2a35c89a6
  1. 6
      class/class.core.php
  2. 8
      class/class.database.php
  3. 2
      fields/multi_links/field.php
  4. 2
      fields/rubrics/field.php
  5. 11
      functions/func.fields.php
  6. 94
      lib/debug/debug.js

6
class/class.core.php

@ -784,7 +784,7 @@
return false;
$cache['id'] = (int)$cache['id'];
$cache['id'] = 'documents/compiled/' . (floor($cache['id'] / 1000)) . '/' . $cache['id'];
$cache['id'] = 'documents/' . (floor($cache['id'] / 1000)) . '/' . $cache['id'];
$cache['file'] = $this->_get_cache_hash() . '.compiled';
@ -1771,7 +1771,7 @@
else
$AVE_DB->clearCacheUrl('url_' . $hash_url);
$this->curentdoc = $AVE_DB->Query($sql, $cache_time, 'url_' . $hash_url, true, '.fetch')->FetchRow();
$this->curentdoc = $AVE_DB->Query($sql, $cache_time, 'url_' . $hash_url, true, '.url')->FetchRow();
if ($this->curentdoc)
{
@ -1803,7 +1803,7 @@
rub.Id = '" . $this->curentdoc->rubric_id . "'
";
$query = $AVE_DB->Query($sql, $cache_time, 'rub_' . $this->curentdoc->rubric_id, true, '.fetch')->FetchRow();
$query = $AVE_DB->Query($sql, $cache_time, 'rub_' . $this->curentdoc->rubric_id, true, '.rubric')->FetchRow();
$this->curentdoc = (object) array_merge((array) $query, (array) $this->curentdoc);

8
class/class.database.php

@ -784,21 +784,21 @@
if (substr($cache_id, 0, 3) == 'dat')
{
$cache_id = (int)str_replace('dat_', '', $cache_id);
return $cache_id = 'documents/data/' . (floor($cache_id / 1000)) . '/' . $cache_id;
return $cache_id = 'documents/' . (floor($cache_id / 1000)) . '/' . $cache_id;
}
//-- Если это скомпилированный шаблон документа, то меняем расположение
if (substr($cache_id, 0, 3) == 'cmd')
{
$cache_id = (int)str_replace('cmd_', '', $cache_id);
return $cache_id = 'documents/compiled/' . (floor($cache_id / 1000)) . '/' . $cache_id;
return $cache_id = 'documents/' . (floor($cache_id / 1000)) . '/' . $cache_id;
}
//-- Если это поля документа, то меняем расположение
if (substr($cache_id, 0, 3) == 'fld')
{
$cache_id = (int)str_replace('fld_', '', $cache_id);
return $cache_id = 'documents/fields/' . (floor($cache_id / 1000)) . '/' . $cache_id;
return $cache_id = 'documents/' . (floor($cache_id / 1000)) . '/' . $cache_id;
}
//-- Сборка страницы
@ -812,7 +812,7 @@
if (substr($cache_id, 0, 3) == 'brd')
{
$cache_id = (int)str_replace('brd_', '', $cache_id);
return $cache_id = 'documents/breadcrumbs/' . (floor($cache_id / 1000)) . '/' . $cache_id;
return $cache_id = 'documents/' . (floor($cache_id / 1000)) . '/' . $cache_id;
}
//-- Если это рубрика, то меняем расположение

2
fields/multi_links/field.php

@ -1,4 +1,4 @@
<?
<?php
/**
* AVE.cms

2
fields/rubrics/field.php

@ -1,4 +1,4 @@
<?
<?php
/**
* AVE.cms

11
functions/func.fields.php

@ -406,11 +406,14 @@
* @internal param int $id id документа
* @return mixed
*/
function get_document_fields ($document_id, $values = null)
function get_document_fields ($document_id, $values = null, $static = true)
{
global $AVE_DB, $AVE_Core; //$request_documents
static $document_fields = array();
if ($static)
static $document_fields = [];
else
$document_fields = [];
if (! is_numeric($document_id))
return false;
@ -450,7 +453,7 @@
" . $where;
$cache_id = (int)$AVE_Core->curentdoc->Id;
$cache_id = 'documents/fields/' . (floor($cache_id / 1000)) . '/' . $cache_id;
$cache_id = 'documents/' . (floor($cache_id / 1000)) . '/' . $cache_id;
$cache_file = md5($query) . '.fields';
@ -487,7 +490,7 @@
$row['field_value'] = (string)$row['field_value'] . (string)$row['field_value_more'];
if ($values)
$row['field_value']=(isset($values[$row['rubric_field_id']]) ? $values[$row['rubric_field_id']] : $row['field_value']);
$row['field_value'] = (isset($values[$row['rubric_field_id']]) ? $values[$row['rubric_field_id']] : $row['field_value']);
if ($row['field_value'] === '')
{

94
lib/debug/debug.js

@ -1,35 +1,77 @@
$(document).ready(function() {
var Debug = {
$('#debug_btn').on('click', function() {
initialized: false,
$bar = $('#debug_bar');
init: function () {
if ($bar.css('display') == 'none') {
$(document.body).css('overflow', 'hidden');
$bar.show();
} else {
$(document.body).css('overflow', '');
$bar.hide();
}
if (this.initialized)
return;
});
this.initialized = true;
$('.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: '/'});
}
});
this.build();
this.events();
},
build: function () {
this.debugCookie();
},
events: function () {
this.debugButton();
this.debugTabs();
},
debugButton: function () {
$('#debug_btn').on('click', function(event) {
event.preventDefault();
$bar = $('#debug_bar');
if ($bar.css('display') == 'none') {
$(document.body).css('overflow', 'hidden');
$bar.show();
} else {
$(document.body).css('overflow', 'inherit');
$bar.hide();
}
});
},
if($.cookie){
var id = $.cookie('__debug_bar');
var tab = $('.debug_tabs > li#'+id);
if(tab.length > 0){
tab.click();
debugTabs: function () {
$('.debug_tabs > li').on('click', function(event) {
event.preventDefault();
$('.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: '/'});
}
});
},
debugCookie: function () {
if ($.cookie) {
var id = $.cookie('__debug_bar');
var tab = $('.debug_tabs > li#' + id);
if (tab.length > 0) {
tab.click();
}
}
}
};
}); //document.ready
$(document).ready(function() {
Debug.init();
});
Loading…
Cancel
Save