AVE.CMS v3.28
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

212 lines
4.6 KiB

7 years ago
<?php
7 years ago
/**
* AVE.cms
*
* @package AVE.cms
* @version 3.x
* @filesource
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru
*
* @license GPL v.2
*/
if (!defined('ACP'))
{
header('Location:index.php');
exit;
}
5 years ago
global $AVE_Template, $AVE_DB;
7 years ago
require(BASE_DIR . '/class/class.docs.php');
require(BASE_DIR . '/class/class.settings.php');
$AVE_Settings = new AVE_Settings;
$AVE_Document = new AVE_Document;
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/settings.txt','settings');
switch($_REQUEST['action'])
{
case '':
switch ($_REQUEST['sub'])
7 years ago
{
7 years ago
case '':
5 years ago
if (check_permission_acp('gen_settings'))
$AVE_Settings->settingsShow();
7 years ago
break;
7 years ago
7 years ago
case 'case':
5 years ago
if(check_permission_acp('gen_settings_more'))
$AVE_Settings->settingsCase();
7 years ago
break;
7 years ago
7 years ago
case 'save':
5 years ago
if (isset($_REQUEST['more']))
{
if (check_permission_acp('gen_settings_more'))
$AVE_Settings->settingsCase();
7 years ago
}
5 years ago
else
{
if (check_permission_acp('gen_settings'))
$AVE_Settings->settingsSave();
}
7 years ago
break;
case 'countries':
5 years ago
if (check_permission_acp('gen_settings_countries'))
7 years ago
{
5 years ago
if (isset($_REQUEST['save']) && $_REQUEST['save'] == 1)
{
$AVE_Settings->settingsCountriesSave();
7 years ago
5 years ago
header('Location:index.php?do=settings&sub=countries&cp=' . SESSION);
exit;
}
$AVE_Settings->settingsCountriesList();
7 years ago
}
break;
7 years ago
7 years ago
case 'language':
5 years ago
if(check_permission_acp('gen_settings_languages'))
{
if (isset($_REQUEST['func']))
7 years ago
{
5 years ago
switch($_REQUEST['func'])
{
case 'default':
if(isset($_REQUEST['Id']))
{
$exists = $AVE_DB->Query("SELECT Id FROM ".PREFIX."_settings_lang WHERE Id=".(int)$_REQUEST['Id'])->GetCell();
if ($exists)
{
$AVE_DB->Query("UPDATE ".PREFIX."_settings_lang SET lang_default=0");
$AVE_DB->Query("UPDATE ".PREFIX."_settings_lang SET lang_default=1 WHERE Id=".(int)$_REQUEST['Id']." LIMIT 1");
}
7 years ago
}
5 years ago
header('Location:index.php?do=settings&sub=language&cp=' . SESSION);
exit;
case 'on':
if (isset($_REQUEST['Id']))
$AVE_DB->Query("UPDATE ".PREFIX."_settings_lang SET lang_status=1 WHERE Id=".(int)$_REQUEST['Id']);
header('Location:index.php?do=settings&sub=language&cp=' . SESSION);
exit;
case 'off':
if (isset($_REQUEST['Id']))
$AVE_DB->Query("UPDATE ".PREFIX."_settings_lang SET lang_status=0 WHERE Id=".(int)$_REQUEST['Id']);
header('Location:index.php?do=settings&sub=language&cp=' . SESSION);
exit;
case 'save':
$AVE_Settings->settingsLanguageEditSave();
exit;
}
}
else
{
$AVE_Settings->settingsLanguageList();
7 years ago
}
}
5 years ago
break;
7 years ago
case 'editlang':
5 years ago
if (check_permission_acp('gen_settings_languages'))
$AVE_Settings->settingsLanguageEdit();
7 years ago
break;
7 years ago
case 'clearcache':
5 years ago
if (check_permission_acp('cache_clear'))
{
$AVE_Template->CacheClear();
exit;
}
break;
7 years ago
7 years ago
case 'clearthumb':
5 years ago
if (check_permission_acp('cache_thumb'))
{
$AVE_Template->ThumbnailsClear();
exit;
}
break;
7 years ago
7 years ago
case 'clearrevision':
5 years ago
if (check_permission_acp('document_revisions'))
{
$AVE_Document->documentsRevisionsClear();
exit;
}
break;
7 years ago
7 years ago
case 'clearcounter':
5 years ago
if (check_permission_acp('gen_settings'))
{
$AVE_Document->documentCounterClear();
exit;
}
break;
7 years ago
7 years ago
case 'showcache':
cacheShow();
exit;
7 years ago
case 'showcountdocs':
$rubric_id = isset($_REQUEST['rubric_id']) ? $_REQUEST['rubric_id'] : null;
countDocuments($rubric_id);
exit;
7 years ago
}
7 years ago
break;
//-- v3.2
case 'paginations':
$AVE_Settings->settingsPaginationsList();
break;
case 'new_paginations':
$AVE_Settings->settingsPaginationsNew();
break;
case 'edit_paginations':
$AVE_Settings->settingsPaginationsEdit();
break;
case 'save_paginations':
$AVE_Settings->settingsPaginationsSave();
break;
case 'del_paginations':
$AVE_Settings->settingsPaginationsDel();
break;
//-- v3.2
//-- v3.24
case 'robots':
$AVE_Settings->editRobots();
break;
case 'custom':
$AVE_Settings->editCustom();
break;
//-- v3.24
5 years ago
//-- v3.27
case 'showcache':
$AVE_Settings->showCache();
break;
case 'showsize':
$AVE_Settings->showCacheSize();
break;
case 'cacheclear':
$AVE_Settings->clearCache();
break;
//-- v3.27
7 years ago
}
7 years ago
?>