mirror of https://github.com/avecms/AVE.cms.git
M@d D3n
7 years ago
94 changed files with 8478 additions and 7380 deletions
@ -1,97 +1,99 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
* @license GPL v.2 |
||||
*/ |
||||
/** |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
* @license GPL v.2 |
||||
*/ |
||||
|
||||
define('ACP', 1); |
||||
define('ACPL', 1); |
||||
define('BASE_DIR', str_replace("\\", "/", dirname(dirname(__FILE__)))); |
||||
define('ACP', 1); |
||||
define('ACPL', 1); |
||||
define('BASE_DIR', str_replace("\\", "/", dirname(dirname(__FILE__)))); |
||||
|
||||
if (! @filesize(BASE_DIR . '/inc/db.config.php')) { |
||||
header('Location:/install/index.php'); |
||||
exit; |
||||
} |
||||
if (! @filesize(BASE_DIR . '/inc/db.config.php')) |
||||
{ |
||||
header('Location:/install/index.php'); |
||||
exit; |
||||
} |
||||
|
||||
require(BASE_DIR . '/admin/init.php'); |
||||
require(BASE_DIR . '/admin/init.php'); |
||||
|
||||
unset ($captcha_ok); |
||||
unset ($captcha_ok); |
||||
|
||||
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'logout') |
||||
{ |
||||
// Завершение работы в админке |
||||
reportLog($AVE_Template->get_config_vars('EXIT_ADMIN')); |
||||
user_logout(); |
||||
header('Location:admin.php'); |
||||
} |
||||
if (isset($_REQUEST['do']) && $_REQUEST['do'] == 'logout') |
||||
{ |
||||
// Завершение работы в админке |
||||
reportLog($AVE_Template->get_config_vars('EXIT_ADMIN')); |
||||
user_logout(); |
||||
header('Location:admin.php'); |
||||
} |
||||
|
||||
if(auth_cookie()) |
||||
{ |
||||
header('Location:index.php'); |
||||
exit; |
||||
} |
||||
if (auth_cookie()) |
||||
{ |
||||
header('Location:index.php'); |
||||
exit; |
||||
} |
||||
|
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login') |
||||
{ |
||||
// Авторизация |
||||
if (!empty($_POST['user_login']) && !empty($_POST['user_pass'])) |
||||
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'login') |
||||
{ |
||||
if (ADMIN_CAPTCHA) |
||||
// Авторизация |
||||
if (! empty($_POST['user_login']) && !empty($_POST['user_pass'])) |
||||
{ |
||||
if (isset($_SESSION['captcha_keystring']) && isset($_POST['securecode']) && $_SESSION['captcha_keystring'] == $_POST['securecode']) $captcha_ok = 1; |
||||
else |
||||
if (ADMIN_CAPTCHA) |
||||
{ |
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']); |
||||
unset($_SESSION['captcha_keystring']); |
||||
$error = $AVE_Template->get_config_vars('WRONG_CAPTCHA'); |
||||
$AVE_Template->assign('error', $error); |
||||
if (isset($_SESSION['captcha_keystring']) && isset($_POST['securecode']) && $_SESSION['captcha_keystring'] == $_POST['securecode']) |
||||
$captcha_ok = 1; |
||||
else |
||||
{ |
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']); |
||||
unset($_SESSION['captcha_keystring']); |
||||
$error = $AVE_Template->get_config_vars('WRONG_CAPTCHA'); |
||||
$AVE_Template->assign('error', $error); |
||||
} |
||||
} |
||||
} |
||||
else |
||||
$captcha_ok = 1; |
||||
else |
||||
$captcha_ok = 1; |
||||
|
||||
if ($captcha_ok) |
||||
{ |
||||
if (true === user_login($_POST['user_login'], $_POST['user_pass'], 1,(int)(isset($_POST['SaveLogin']) && $_POST['SaveLogin'] == '1'))) |
||||
if ($captcha_ok) |
||||
{ |
||||
//_echo($_SESSION); |
||||
if (!empty($_SESSION['redirectlink'])) |
||||
if (true === user_login($_POST['user_login'], $_POST['user_pass'], 1,(int)(isset($_POST['SaveLogin']) && $_POST['SaveLogin'] == '1'))) |
||||
{ |
||||
header('Location:' . $_SESSION['redirectlink']); |
||||
unset($_SESSION['redirectlink']); |
||||
//_echo($_SESSION); |
||||
if (!empty($_SESSION['redirectlink'])) |
||||
{ |
||||
header('Location:' . $_SESSION['redirectlink']); |
||||
unset($_SESSION['redirectlink']); |
||||
exit; |
||||
} |
||||
|
||||
reportLog($AVE_Template->get_config_vars('LOGIN_ADMIN')); |
||||
//Перенапрявляем пользователя |
||||
header('Location:'.get_referer_admin_link().''); |
||||
exit; |
||||
} |
||||
|
||||
reportLog($AVE_Template->get_config_vars('LOGIN_ADMIN')); |
||||
//Перенапрявляем пользователя |
||||
header('Location:'.get_referer_admin_link().''); |
||||
exit; |
||||
} |
||||
else |
||||
{ |
||||
reportLog($AVE_Template->get_config_vars('ERROR_ADMIN') . ' - ' |
||||
. stripslashes($_POST['user_login']) . ' / ' |
||||
. stripslashes($_POST['user_pass'])); |
||||
|
||||
} |
||||
else |
||||
{ |
||||
reportLog($AVE_Template->get_config_vars('ERROR_ADMIN') . ' - ' |
||||
. stripslashes($_POST['user_login']) . ' / ' |
||||
. stripslashes($_POST['user_pass'])); |
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']); |
||||
unset($_SESSION['captcha_keystring']); |
||||
$error = $AVE_Template->get_config_vars('WRONG_PASS'); |
||||
$AVE_Template->assign('error', $error); |
||||
} |
||||
|
||||
unset($_SESSION['user_id'], $_SESSION['user_pass']); |
||||
unset($_SESSION['captcha_keystring']); |
||||
$error = $AVE_Template->get_config_vars('WRONG_PASS'); |
||||
$AVE_Template->assign('error', $error); |
||||
} |
||||
|
||||
} |
||||
|
||||
} |
||||
} |
||||
|
||||
$AVE_Template->assign('captcha', ADMIN_CAPTCHA); |
||||
$AVE_Template->display('login.tpl'); |
||||
$AVE_Template->assign('captcha', ADMIN_CAPTCHA); |
||||
$AVE_Template->display('login.tpl'); |
||||
?> |
@ -1,298 +1,312 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* 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; |
||||
} |
||||
|
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
require(BASE_DIR . '/class/class.docs.php'); |
||||
require(BASE_DIR . '/class/class.rubs.php'); |
||||
require(BASE_DIR . '/class/class.navigation.php'); |
||||
require(BASE_DIR . '/class/class.request.php'); |
||||
|
||||
$AVE_Document = new AVE_Document; |
||||
$AVE_Rubric = new AVE_Rubric; |
||||
$AVE_Navigation = new AVE_Navigation; |
||||
$AVE_Request = new AVE_Request; |
||||
|
||||
$AVE_Document->documentTemplateTimeAssign(); |
||||
|
||||
$AVE_Rubric->rubricPermissionFetch(); |
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/docs.txt', 'docs'); |
||||
|
||||
$AVE_Template->assign("navi", $AVE_Template->fetch("navi/navi.tpl")); |
||||
|
||||
switch($_REQUEST['action']) |
||||
{ |
||||
case '' : |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
switch($_REQUEST['sub']) |
||||
/** |
||||
* 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; |
||||
} |
||||
|
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
require(BASE_DIR . '/class/class.docs.php'); |
||||
require(BASE_DIR . '/class/class.rubs.php'); |
||||
require(BASE_DIR . '/class/class.navigation.php'); |
||||
require(BASE_DIR . '/class/class.request.php'); |
||||
|
||||
$AVE_Document = new AVE_Document; |
||||
$AVE_Rubric = new AVE_Rubric; |
||||
$AVE_Navigation = new AVE_Navigation; |
||||
$AVE_Request = new AVE_Request; |
||||
|
||||
$AVE_Document->documentTemplateTimeAssign(); |
||||
|
||||
$AVE_Rubric->rubricPermissionFetch(); |
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/docs.txt', 'docs'); |
||||
|
||||
$AVE_Template->assign("navi", $AVE_Template->fetch("navi/navi.tpl")); |
||||
|
||||
switch($_REQUEST['action']) |
||||
{ |
||||
case '' : |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
case 'quicksave': |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Document->quickSave(); |
||||
break; |
||||
switch($_REQUEST['sub']) |
||||
{ |
||||
case 'quicksave': |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Document->quickSave(); |
||||
break; |
||||
} |
||||
$AVE_Document->documentListGet(); |
||||
} |
||||
$AVE_Document->documentListGet(); |
||||
} |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs.tpl')); |
||||
break; |
||||
|
||||
case 'add_new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_add_new.tpl')); |
||||
} |
||||
break; |
||||
|
||||
case 'showsimple': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentListGet(); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_simple.tpl')); |
||||
} |
||||
break; |
||||
|
||||
case 'edit': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Document->documentEdit((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'copy': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Document->documentCopy((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Document->documentNew((int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'innavi': |
||||
if (check_permission_acp('document_view') && check_permission_acp('navigation_new')) |
||||
{ |
||||
$AVE_Document->documentInNavi(); |
||||
} |
||||
break; |
||||
|
||||
case 'after': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Document->documentFormAfter(); |
||||
} |
||||
break; |
||||
|
||||
case 'open': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 1); |
||||
} |
||||
break; |
||||
|
||||
case 'close': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 0); |
||||
} |
||||
break; |
||||
|
||||
case 'delete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentMarkDelete((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'redelete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentUnmarkDelete((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'enddelete': |
||||
if (check_permission_acp('alles')) |
||||
{ |
||||
$AVE_Navigation->navigationItemDeleteFromDoc((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentDelete((int)$_REQUEST['Id']); |
||||
// Выполняем обновление страницы |
||||
header('Location:index.php?do=docs&cp=' . SESSION); |
||||
} |
||||
break; |
||||
|
||||
case 'revision_recover': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRevissionRestore((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'revision_delete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRevissionDelete((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'remark': |
||||
if (check_permission_acp('remark_view')) |
||||
{ |
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 0); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_reply': |
||||
if (check_permission_acp('remark_view')) |
||||
{ |
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 1); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_status': |
||||
if (check_permission_acp('remark_edit')) |
||||
{ |
||||
$AVE_Document->documentRemarkStatus((int)$_REQUEST['Id'], (int)$_REQUEST['remark_status']); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_del': |
||||
if (check_permission_acp('remark_edit')) |
||||
{ |
||||
$AVE_Document->documentRemarkDelete((int)$_REQUEST['Id'], (int)$_REQUEST['remark_first']); |
||||
} |
||||
break; |
||||
|
||||
case 'change': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRubricChange(); |
||||
} |
||||
break; |
||||
|
||||
case 'change_user': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
switch($_REQUEST['sub']) |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs.tpl')); |
||||
break; |
||||
|
||||
case 'add_new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
case 'save': |
||||
$AVE_Document->changeAutorSave(); |
||||
break; |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_add_new.tpl')); |
||||
} |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/user.tpl')); |
||||
} |
||||
break; |
||||
|
||||
case 'find_user': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
findautor($_REQUEST['q'], 10); |
||||
} |
||||
exit; |
||||
break; |
||||
|
||||
case 'keywords': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
searchKeywords($_REQUEST['q']); |
||||
} |
||||
exit; |
||||
case 'showsimple': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentListGet(); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/docs_simple.tpl')); |
||||
} |
||||
break; |
||||
|
||||
case 'editstatus': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentEditStatus(); |
||||
} |
||||
break; |
||||
case 'edit': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
if (isset($_REQUEST['sub']) && $_REQUEST['sub'] != 'save') |
||||
{ |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
} |
||||
$AVE_Document->documentEdit((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'image_import': |
||||
echo json_encode(array("respons"=>image_multi_import($_REQUEST['path']), "status"=>"error", "action"=>"return")); |
||||
exit; |
||||
case 'copy': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
$AVE_Document->documentCopy((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'translit': |
||||
echo($AVE_Document->documentAliasCreate()); |
||||
exit; |
||||
case 'new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$_SESSION['use_editor'] = get_settings('use_editor'); |
||||
|
||||
case 'checkurl': |
||||
echo($AVE_Document->documentAliasCheck()); |
||||
exit; |
||||
if (isset($_REQUEST['sub']) && $_REQUEST['sub'] != 'save') |
||||
{ |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Request->requestListFetch(); |
||||
} |
||||
|
||||
$AVE_Document->documentNew((int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'innavi': |
||||
if (check_permission_acp('document_view') && check_permission_acp('navigation_new')) |
||||
{ |
||||
$AVE_Document->documentInNavi(); |
||||
} |
||||
break; |
||||
|
||||
case 'after': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationAllItemList(); |
||||
$AVE_Document->documentFormAfter(); |
||||
} |
||||
break; |
||||
|
||||
case 'open': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 1); |
||||
} |
||||
break; |
||||
|
||||
case 'close': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentStatusSet((int)$_REQUEST['Id'], 0); |
||||
} |
||||
break; |
||||
|
||||
case 'delete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOff((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentMarkDelete((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'redelete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Navigation->navigationItemStatusOn((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentUnmarkDelete((int)$_REQUEST['Id']); |
||||
} |
||||
break; |
||||
|
||||
case 'enddelete': |
||||
if (check_permission_acp('alles')) |
||||
{ |
||||
$AVE_Navigation->navigationItemDeleteFromDoc((int)$_REQUEST['Id']); |
||||
$AVE_Document->documentDelete((int)$_REQUEST['Id']); |
||||
// Выполняем обновление страницы |
||||
header('Location:index.php?do=docs&cp=' . SESSION); |
||||
} |
||||
break; |
||||
|
||||
case 'revision_recover': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRevissionRestore((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'revision_delete': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRevissionDelete((int)$_REQUEST['doc_id'], (int)$_REQUEST['revission'], (int)$_REQUEST['rubric_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'remark': |
||||
if (check_permission_acp('remark_view')) |
||||
{ |
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 0); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_reply': |
||||
if (check_permission_acp('remark_view')) |
||||
{ |
||||
$AVE_Document->documentRemarkNew((int)$_REQUEST['Id'], 1); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_status': |
||||
if (check_permission_acp('remark_edit')) |
||||
{ |
||||
$AVE_Document->documentRemarkStatus((int)$_REQUEST['Id'], (int)$_REQUEST['remark_status']); |
||||
} |
||||
break; |
||||
|
||||
case 'remark_del': |
||||
if (check_permission_acp('remark_edit')) |
||||
{ |
||||
$AVE_Document->documentRemarkDelete((int)$_REQUEST['Id'], (int)$_REQUEST['remark_first']); |
||||
} |
||||
break; |
||||
|
||||
case 'change': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentRubricChange(); |
||||
} |
||||
break; |
||||
|
||||
case 'change_user': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
switch($_REQUEST['sub']) |
||||
{ |
||||
case 'save': |
||||
$AVE_Document->changeAutorSave(); |
||||
break; |
||||
} |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('documents/user.tpl')); |
||||
} |
||||
break; |
||||
|
||||
case 'find_user': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
findautor($_REQUEST['q'], 10); |
||||
} |
||||
exit; |
||||
|
||||
case 'keywords': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
searchKeywords($_REQUEST['q']); |
||||
} |
||||
exit; |
||||
|
||||
case 'aliases': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasHistoryList(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_doc': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasListDoc((int)$_REQUEST['doc_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasNew(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_edit': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasEdit(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_save': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasSave(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_del': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasDel(); |
||||
} |
||||
break; |
||||
} |
||||
case 'editstatus': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentEditStatus(); |
||||
} |
||||
break; |
||||
|
||||
case 'image_import': |
||||
echo json_encode(array("respons"=>image_multi_import($_REQUEST['path']), "status"=>"error", "action"=>"return")); |
||||
exit; |
||||
|
||||
case 'translit': |
||||
echo($AVE_Document->documentAliasCreate()); |
||||
exit; |
||||
|
||||
case 'checkurl': |
||||
echo($AVE_Document->documentAliasCheck()); |
||||
exit; |
||||
|
||||
case 'aliases': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasHistoryList(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_doc': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasListDoc((int)$_REQUEST['doc_id']); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_new': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasNew(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_edit': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasEdit(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_save': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasSave(); |
||||
} |
||||
break; |
||||
|
||||
case 'aliases_del': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentAliasDel(); |
||||
} |
||||
break; |
||||
|
||||
case 'redirect': |
||||
if (check_permission_acp('document_view')) |
||||
{ |
||||
$AVE_Document->documentSaveRedirect(); |
||||
} |
||||
break; |
||||
} |
||||
?> |
File diff suppressed because it is too large
Load Diff
@ -1,43 +1,48 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* 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; |
||||
} |
||||
|
||||
require(BASE_DIR . '/inc/init.php'); |
||||
require(BASE_DIR . '/admin/functions/func.admin.common.php'); |
||||
require(BASE_DIR . '/lib/redactor/ckeditor/adapters/ckeditor.php'); |
||||
|
||||
$lang_system = $AVE_DB->Query(" |
||||
SELECT lang_alias_pref FROM " . PREFIX . "_settings_lang |
||||
WHERE lang_default = '1' |
||||
")->GetCell(); |
||||
|
||||
$_SESSION['admin_language'] = $lang_system; |
||||
|
||||
$AVE_Template = new AVE_Template(BASE_DIR . '/admin/templates'); |
||||
$AVE_Template->assign('tpl_dir', ABS_PATH . 'admin/templates'); |
||||
|
||||
// Файлы шаблонов для CodeMirror |
||||
$AVE_Template->assign('codemirror_connect', BASE_DIR . '/lib/redactor/codemirror/codemirror_connect.tpl'); |
||||
$AVE_Template->assign('codemirror_editor', BASE_DIR . '/lib/redactor/codemirror/codemirror_editor.tpl'); |
||||
|
||||
// Подключаем основные ланги |
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/main.txt'); |
||||
|
||||
define('SESSION', session_id()); |
||||
$AVE_Template->assign('sess', SESSION); |
||||
/** |
||||
* 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; |
||||
} |
||||
|
||||
require (BASE_DIR . '/inc/init.php'); |
||||
|
||||
$AVE_Template = new AVE_Template(BASE_DIR . '/admin/templates'); |
||||
$AVE_Template->assign('tpl_dir', ABS_PATH . 'admin/templates'); |
||||
|
||||
require (BASE_DIR . '/admin/functions/func.admin.common.php'); |
||||
require (BASE_DIR . '/lib/redactor/ckeditor/adapters/ckeditor.php'); |
||||
|
||||
$lang_system = $AVE_DB->Query(" |
||||
SELECT |
||||
lang_alias_pref |
||||
FROM |
||||
" . PREFIX . "_settings_lang |
||||
WHERE |
||||
lang_default = '1' |
||||
")->GetCell(); |
||||
|
||||
$_SESSION['admin_language'] = $lang_system; |
||||
|
||||
// Файлы шаблонов для CodeMirror |
||||
$AVE_Template->assign('codemirror_connect', BASE_DIR . '/lib/redactor/codemirror/codemirror_connect.tpl'); |
||||
$AVE_Template->assign('codemirror_editor', BASE_DIR . '/lib/redactor/codemirror/codemirror_editor.tpl'); |
||||
|
||||
// Подключаем основные ланги |
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/main.txt'); |
||||
|
||||
define('SESSION', session_id()); |
||||
$AVE_Template->assign('sess', SESSION); |
||||
?> |
@ -1,99 +1,102 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
* @license GPL v.2 |
||||
*/ |
||||
/** |
||||
* 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; |
||||
} |
||||
|
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/modules.txt', 'modules'); |
||||
|
||||
if (!empty($_REQUEST['moduleaction'])) |
||||
{ |
||||
if (!check_permission('mod_' . $_REQUEST['mod'])) |
||||
if (! defined('ACP')) |
||||
{ |
||||
echo $AVE_Template->get_config_vars('MAIN_NO_PERM_MODULES'); |
||||
header('Location:index.php'); |
||||
exit; |
||||
} |
||||
} |
||||
|
||||
if (!empty($_REQUEST['module'])) |
||||
{ |
||||
$module_path = preg_replace('/[^\w]/', '', $_REQUEST['module']); |
||||
if (!empty($module_path)) define('MODULE_PATH', $module_path); |
||||
} |
||||
$AVE_Template->config_load(BASE_DIR . '/admin/lang/' . $_SESSION['admin_language'] . '/modules.txt', 'modules'); |
||||
|
||||
switch($_REQUEST['action']) |
||||
{ |
||||
case '': |
||||
if (check_permission_acp('modules_view')) |
||||
if (! empty($_REQUEST['moduleaction'])) |
||||
{ |
||||
if (! check_permission('mod_' . $_REQUEST['mod'])) |
||||
{ |
||||
$AVE_Module->moduleList(); |
||||
echo $AVE_Template->get_config_vars('MAIN_NO_PERM_MODULES'); |
||||
exit; |
||||
} |
||||
break; |
||||
} |
||||
|
||||
case 'quicksave': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleOptionsSave(); |
||||
} |
||||
break; |
||||
if (! empty($_REQUEST['module'])) |
||||
{ |
||||
$module_path = preg_replace('/[^\w]/', '', $_REQUEST['module']); |
||||
|
||||
case 'install': |
||||
case 'reinstall': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleInstall(); |
||||
} |
||||
break; |
||||
if (! empty($module_path)) |
||||
define('MODULE_PATH', $module_path); |
||||
} |
||||
|
||||
case 'update': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleUpdate(); |
||||
} |
||||
break; |
||||
switch($_REQUEST['action']) |
||||
{ |
||||
case '': |
||||
if (check_permission_acp('modules_view')) |
||||
{ |
||||
$AVE_Module->moduleList(); |
||||
} |
||||
break; |
||||
|
||||
case 'delete': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleDelete(); |
||||
} |
||||
break; |
||||
case 'quicksave': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleOptionsSave(); |
||||
} |
||||
break; |
||||
|
||||
case 'onoff': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleStatusChange(); |
||||
} |
||||
break; |
||||
case 'install': |
||||
case 'reinstall': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleInstall(); |
||||
} |
||||
break; |
||||
|
||||
case 'modedit': |
||||
if (check_permission_acp('modules_admin')) |
||||
{ |
||||
$mod_path = preg_replace('/[^\w]/', '', $_REQUEST['mod']); |
||||
$mod_path = BASE_DIR . '/modules/' . $mod_path . '/module.php'; |
||||
if (is_file($mod_path)) include($mod_path); |
||||
} |
||||
break; |
||||
case 'update': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleUpdate(); |
||||
} |
||||
break; |
||||
|
||||
case 'remove': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleRemove($_REQUEST['module']); |
||||
} |
||||
break; |
||||
} |
||||
case 'delete': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleDelete(); |
||||
} |
||||
break; |
||||
|
||||
case 'onoff': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleStatusChange(); |
||||
} |
||||
break; |
||||
|
||||
case 'modedit': |
||||
if (check_permission_acp('modules_admin')) |
||||
{ |
||||
$mod_path = preg_replace('/[^\w]/', '', $_REQUEST['mod']); |
||||
$mod_path = BASE_DIR . '/modules/' . $mod_path . '/module.php'; |
||||
|
||||
if (is_file($mod_path)) |
||||
include($mod_path); |
||||
} |
||||
break; |
||||
|
||||
case 'remove': |
||||
if (check_permission_acp('modules_system')) |
||||
{ |
||||
$AVE_Module->moduleRemove($_REQUEST['module']); |
||||
} |
||||
break; |
||||
} |
||||
?> |
@ -1,300 +1,294 @@
|
||||
<!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> |
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
||||
|
||||
<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"> |
||||
|
||||
<!-- 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/nestable.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 Scripts --> |
||||
<script> |
||||
var ave_path = "{$ABS_PATH}"; |
||||
var ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}"; |
||||
var ave_admintpl = "{$tpl_dir}"; |
||||
</script> |
||||
|
||||
<script type="text/javascript" language="JavaScript"> |
||||
$(document).ready(function(){ldelim} |
||||
|
||||
{if $smarty.const.ADMIN_MENU} |
||||
$("#menu").sticky({ldelim}topSpacing:56{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('group_edit')} |
||||
$(".ulAddGroup").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_GROUP#}'; |
||||
var text = '{#MAIN_ADD_NEW_GROUP_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=groups&action=new&cp={$sess}'+ '&user_group_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_GROUP#}", {ldelim}theme: 'error'{rdelim}); |
||||
<head> |
||||
|
||||
<meta http-equiv="content-type" content="text/html; charset=UTF-8" /> |
||||
|
||||
<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"> |
||||
|
||||
<!-- 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/nestable.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 Scripts --> |
||||
<script> |
||||
var ave_path = "{$ABS_PATH}"; |
||||
var ave_theme = "{$smarty.const.DEFAULT_THEME_FOLDER}"; |
||||
var ave_admintpl = "{$tpl_dir}"; |
||||
</script> |
||||
|
||||
<script type="text/javascript" language="JavaScript"> |
||||
$(document).ready(function(){ldelim} |
||||
|
||||
{if $smarty.const.ADMIN_MENU} |
||||
$("#menu").sticky({ldelim}topSpacing:56{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('group_edit')} |
||||
$(".ulAddGroup").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_GROUP#}'; |
||||
var text = '{#MAIN_ADD_NEW_GROUP_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=groups&action=new&cp={$sess}'+ '&user_group_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_GROUP#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('user_edit')} |
||||
$(".ulAddUser").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_USER#}'; |
||||
var text = '{#MAIN_ADD_NEW_USER_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=user&action=new&cp={$sess}'+ '&user_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_USER#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('user_edit')} |
||||
$(".ulAddUser").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_USER#}'; |
||||
var text = '{#MAIN_ADD_NEW_USER_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=user&action=new&cp={$sess}'+ '&user_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_USER#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('navigation_edit')} |
||||
$(".ulAddNav").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_NAV#}'; |
||||
var text = '{#MAIN_ADD_NEW_NAV_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=navigation&action=new&cp={$sess}'+ '&NaviName=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_NAV#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('navigation_edit')} |
||||
$(".ulAddNav").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_NAV#}'; |
||||
var text = '{#MAIN_ADD_NEW_NAV_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=navigation&action=new&cp={$sess}'+ '&NaviName=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_NAV#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('template_edit')} |
||||
$(".ulAddTempl").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_TEMPL#}'; |
||||
var text = '{#MAIN_ADD_NEW_TEMPL_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=templates&action=new&cp={$sess}'+ '&TempName=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_TEMPL#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('template_edit')} |
||||
$(".ulAddTempl").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_TEMPL#}'; |
||||
var text = '{#MAIN_ADD_NEW_TEMPL_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=templates&action=new&cp={$sess}'+ '&TempName=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_TEMPL#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('request_edit')} |
||||
$(".ulAddRequest").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_REQUEST#}'; |
||||
var text = '{#MAIN_ADD_NEW_REQUEST_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=request&action=new&cp={$sess}'+ '&request_title_new=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_QUERY#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('request_edit')} |
||||
$(".ulAddRequest").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_REQUEST#}'; |
||||
var text = '{#MAIN_ADD_NEW_REQUEST_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=request&action=new&cp={$sess}'+ '&request_title_new=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_QUERY#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('rubric_edit')} |
||||
$(".ulAddRub").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_RUB#}'; |
||||
var text = '{#MAIN_ADD_NEW_RUB_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=rubs&action=new&cp={$sess}'+ '&rubric_title=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_RUB#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('rubric_edit')} |
||||
$(".ulAddRub").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_RUB#}'; |
||||
var text = '{#MAIN_ADD_NEW_RUB_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=rubs&action=new&cp={$sess}'+ '&rubric_title=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_RUB#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('sysblocks_edit')} |
||||
$(".ulAddBlock").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_BLOCK#}'; |
||||
var text = '{#MAIN_ADD_NEW_BLOCK_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=sysblocks&action=new&cp={$sess}'+ '&sysblock_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_BLOCK#}", {ldelim}theme: 'error'{rdelim}); |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{if check_permission('sysblocks_edit')} |
||||
$(".ulAddBlock").click( function(e) {ldelim} |
||||
e.preventDefault(); |
||||
var title = '{#MAIN_ADD_NEW_BLOCK#}'; |
||||
var text = '{#MAIN_ADD_NEW_BLOCK_NAME#}'; |
||||
jPrompt(text, '', title, function(b){ldelim} |
||||
if (b){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.alerts._overlay('show'); |
||||
window.location = ave_path+'admin/index.php?do=sysblocks&action=new&cp={$sess}'+ '&sysblock_name=' + b; |
||||
{rdelim}else{ldelim} |
||||
$.jGrowl("{#MAIN_NO_ADD_BLOCK#}", {ldelim}theme: 'error'{rdelim}); |
||||
{rdelim} |
||||
{rdelim} |
||||
{rdelim} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
); |
||||
{rdelim}); |
||||
{/if} |
||||
|
||||
{rdelim}); |
||||
</script> |
||||
{rdelim}); |
||||
</script> |
||||
|
||||
</head> |
||||
</head> |
||||
|
||||
<body> |
||||
<body> |
||||
|
||||
<div id="leftNav_show"> |
||||
<a href="javascript:void(0);" id="toggle-LeftMenu"><span class="rightDir {if $smarty.cookies.LeftMenu != "hidden"}close{/if}" title="{#MAIN_SHOWHIDE#}"></span></a> |
||||
</div> |
||||
<div id="leftNav_show"> |
||||
<a href="javascript:void(0);" id="toggle-LeftMenu"><span class="rightDir {if $smarty.cookies.LeftMenu != "hidden"}close{/if}" title="{#MAIN_SHOWHIDE#}"></span></a> |
||||
</div> |
||||
|
||||
<!-- Top Menu --> |
||||
<div id="topNav"> |
||||
<div class="fixed"> |
||||
<div class="wrapper"> |
||||
<div class="welcome"> |
||||
{if $user_avatar} |
||||
<img src="{$user_avatar}" class="avatar" alt="{$smarty.session.user_name|escape}" /> |
||||
{else} |
||||
<img src="{$tpl_dir}/images/userPic.png" class="avatar" alt="" /> |
||||
{/if} |
||||
<span>{#MAIN_USER_ONLINE#} <strong>{$smarty.session.user_name|escape}</strong></span> |
||||
</div> |
||||
<div class="userNav"> |
||||
<ul> |
||||
{if check_permission('documents_edit') || check_permission('rubric_edit') || check_permission('request_edit') || check_permission('sysblocks_edit') || check_permission('template_edit') || check_permission('navigation_edit') || check_permission('user_edit') || check_permission('group_edit')} |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/add.png" alt="" /><span>{#MAIN_BUTTON_ADD#}</span></a> |
||||
<ul> |
||||
{if check_permission('documents_edit')}<li><a onclick="windowOpen('index.php?do=docs&action=add_new&pop=1&cp={$sess}','750','500','1')" href="javascript:void(0);">{#MAIN_ADD_DOC#}</a></li>{/if} |
||||
{if check_permission('rubric_edit')}<li><a class="ulAddRub" href="index.php?do=rubs&action=new&cp={$sess}">{#MAIN_ADD_RUB#}</a></li>{/if} |
||||
{if check_permission('request_edit')}<li><a class="ulAddRequest" href="index.php?do=request&action=new&cp={$sess}">{#MAIN_ADD_REQ#}</a></li>{/if} |
||||
{if check_permission('sysblocks_edit')}<li><a class="ulAddBlock" href="index.php?do=sysblocks&action=new&cp={$sess}">{#MAIN_ADD_SYS#}</a></li>{/if} |
||||
{if check_permission('template_edit')}<li><a class="ulAddTempl" href="index.php?do=templates&action=new&cp={$sess}">{#MAIN_ADD_TEM#}</a></li>{/if} |
||||
{if check_permission('navigation_edit')}<li><a class="ulAddNav" href="index.php?do=navigation&action=new&cp={$sess}">{#MAIN_ADD_NAV#}</a></li>{/if} |
||||
{if check_permission('user_edit')}<li><a class="ulAddUser" href="index.php?do=user&action=new&cp={$sess}">{#MAIN_ADD_USR#}</a></li>{/if} |
||||
{if check_permission('group_edit')}<li><a class="ulAddGroup" href="index.php?do=groups&action=new&cp={$sess}">{#MAIN_ADD_GRP#}</a></li>{/if} |
||||
</ul> |
||||
</li> |
||||
<!-- Top Menu --> |
||||
<div id="topNav"> |
||||
<div class="fixed"> |
||||
<div class="wrapper"> |
||||
<div class="welcome"> |
||||
{if $user_avatar} |
||||
<img src="{$user_avatar}" class="avatar" alt="{$smarty.session.user_name|escape}" /> |
||||
{else} |
||||
<img src="{$tpl_dir}/images/userPic.png" class="avatar" alt="" /> |
||||
{/if} |
||||
<span>{#MAIN_USER_ONLINE#} <strong>{$smarty.session.user_name|escape}</strong></span> |
||||
</div> |
||||
<div class="userNav"> |
||||
<ul> |
||||
{if $smarty.const.ADMIN_MENU_QUICK_ADD} |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/add.png" alt="" /><span>{#MAIN_BUTTON_ADD#}</span></a> |
||||
<ul> |
||||
{if check_permission('documents_edit')}<li><a onclick="windowOpen('index.php?do=docs&action=add_new&pop=1&cp={$sess}','750','500','1')" href="javascript:void(0);">{#MAIN_ADD_DOC#}</a></li>{/if} |
||||
{if check_permission('rubric_edit')}<li><a class="ulAddRub" href="index.php?do=rubs&action=new&cp={$sess}">{#MAIN_ADD_RUB#}</a></li>{/if} |
||||
{if check_permission('request_edit')}<li><a class="ulAddRequest" href="index.php?do=request&action=new&cp={$sess}">{#MAIN_ADD_REQ#}</a></li>{/if} |
||||
{if check_permission('sysblocks_edit')}<li><a class="ulAddBlock" href="index.php?do=sysblocks&action=new&cp={$sess}">{#MAIN_ADD_SYS#}</a></li>{/if} |
||||
{if check_permission('template_edit')}<li><a class="ulAddTempl" href="index.php?do=templates&action=new&cp={$sess}">{#MAIN_ADD_TEM#}</a></li>{/if} |
||||
{if check_permission('navigation_edit')}<li><a class="ulAddNav" href="index.php?do=navigation&action=new&cp={$sess}">{#MAIN_ADD_NAV#}</a></li>{/if} |
||||
{if check_permission('user_edit')}<li><a class="ulAddUser" href="index.php?do=user&action=new&cp={$sess}">{#MAIN_ADD_USR#}</a></li>{/if} |
||||
{if check_permission('group_edit')}<li><a class="ulAddGroup" href="index.php?do=groups&action=new&cp={$sess}">{#MAIN_ADD_GRP#}</a></li>{/if} |
||||
</ul> |
||||
</li> |
||||
{/if} |
||||
|
||||
<li class="dropdown dd_page" {if $smarty.cookies.LeftMenu == "visible"}style="display: none;"{/if}><a title=""><img src="{$tpl_dir}/images/icons/tasks.png" alt="" /><span>{#MAIN_BRANCHES#}</span></a> |
||||
<ul class="menu_page"> |
||||
{$navi_top} |
||||
</ul> |
||||
</li> |
||||
|
||||
{* |
||||
<li><img src="{$tpl_dir}/images/icons/messages.png" alt="" /><span>Messages</span><span class="numberTop">8</span></li> |
||||
*} |
||||
{if check_permission('modules_view')} |
||||
{if $modules} |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/subInbox.png" alt="" /><span>{#MAIN_LINK_MODULES_H#}</span></a> |
||||
{if $modules && check_permission('modules_view')} |
||||
<ul> |
||||
{foreach from=$modules item=modul} |
||||
<li><a href="index.php?do=modules&action=modedit&mod={$modul->ModuleSysName}&moduleaction=1&cp={$sess}">{$modul->ModuleName}</a></li> |
||||
{/foreach} |
||||
</ul> |
||||
<li class="dropdown dd_page" {if $smarty.cookies.LeftMenu == "visible"}style="display: none;"{/if}> |
||||
<a title=""><img src="{$tpl_dir}/images/icons/tasks.png" alt="" /><span>{#MAIN_BRANCHES#}</span></a> |
||||
<ul class="menu_page"> |
||||
{$navi_top} |
||||
</ul> |
||||
</li> |
||||
|
||||
{if check_permission('modules_view')} |
||||
{if $modules} |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/subInbox.png" alt="" /><span>{#MAIN_LINK_MODULES_H#}</span></a> |
||||
{if $modules && check_permission('modules_view')} |
||||
<ul> |
||||
{foreach from=$modules item=module} |
||||
<li><a href="index.php?do=modules&action=modedit&mod={$module.ModuleSysName}&moduleaction=1&cp={$sess}">{$module.ModuleName}</a></li> |
||||
{/foreach} |
||||
</ul> |
||||
{/if} |
||||
</li> |
||||
{/if} |
||||
</li> |
||||
{/if} |
||||
{/if} |
||||
{if check_permission('gen_settings') || check_permission('gen_settings_more') || check_permission('dbactions') || check_permission('gen_settings_countries') || check_permission('gen_settings_languages') } |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/settings.png" alt="" /><span>{#MAIN_LINK_SETTINGS_H#}</span></a> |
||||
<ul> |
||||
{if check_permission('gen_settings')}<li><a href="index.php?do=settings&cp={$sess}">{#MAIN_SETTINGS_EDIT_1#}</a></li>{/if} |
||||
{if check_permission('gen_settings_more')}<li><a href="index.php?do=settings&sub=case&cp={$sess}">{#MAIN_SETTINGS_EDIT_2#}</a></li>{/if} |
||||
{if check_permission('gen_settings_countries')}<li><a href="index.php?do=settings&sub=countries&cp={$sess}">{#MAIN_SETTINGS_EDIT_3#}</a></li>{/if} |
||||
{if check_permission('gen_settings_languages')}<li><a href="index.php?do=settings&sub=language&cp={$sess}">{#MAIN_LINK_LANG#}</a></li>{/if} |
||||
{if check_permission('db_actions')}<li><a href="index.php?do=dbsettings&action=dump_top&cp={$sess}">{#MAIN_SETTINGS_EDIT_4#}</a></li>{/if} |
||||
</ul> |
||||
</li> |
||||
{/if} |
||||
{if check_permission('cache_clear')}<li><a href="javascript:void(0);" class="clearCache" title="{#MAIN_STAT_CLEAR_CACHE#}"><img src="{$tpl_dir}/images/icons/subTrash.png" alt="" /><span>{#MAIN_STAT_CLEAR_CACHE#}</span></a></li>{/if} |
||||
{* |
||||
<li><a href="#" title="{#MAIN_LOGIN_HELP#}"><img src="{$tpl_dir}/images/icons/help.png" alt="" /><span>{#MAIN_LOGIN_HELP#}</span></a></li> |
||||
*} |
||||
<li> |
||||
<a href="../" title="{#MAIN_LINK_SITE#}" target="_blank"><img src="{$tpl_dir}/images/icons/preview.png" alt="" /><span>{#MAIN_LINK_SITE#}</span></a> |
||||
</li> |
||||
<li><a href="admin.php?do=logout" class="ConfirmLogOut" title="{#MAIN_BUTTON_LOGOUT#}"><img src="{$tpl_dir}/images/icons/logout.png" alt="" /><span>{#MAIN_BUTTON_LOGOUT#}</span></a></li> |
||||
</ul> |
||||
{/if} |
||||
{if check_permission('gen_settings') || check_permission('gen_settings_more') || check_permission('dbactions') || check_permission('gen_settings_countries') || check_permission('gen_settings_languages') } |
||||
<li class="dropdown"><a title=""><img src="{$tpl_dir}/images/icons/settings.png" alt="" /><span>{#MAIN_LINK_SETTINGS_H#}</span></a> |
||||
<ul> |
||||
{if check_permission('gen_settings')}<li><a href="index.php?do=settings&cp={$sess}">{#MAIN_SETTINGS_EDIT_1#}</a></li>{/if} |
||||
{if check_permission('gen_settings_more')}<li><a href="index.php?do=settings&sub=case&cp={$sess}">{#MAIN_SETTINGS_EDIT_2#}</a></li>{/if} |
||||
{if check_permission('gen_settings_countries')}<li><a href="index.php?do=settings&sub=countries&cp={$sess}">{#MAIN_SETTINGS_EDIT_3#}</a></li>{/if} |
||||
{if check_permission('gen_settings_languages')}<li><a href="index.php?do=settings&sub=language&cp={$sess}">{#MAIN_LINK_LANG#}</a></li>{/if} |
||||
{if check_permission('db_actions')}<li><a href="index.php?do=dbsettings&action=dump_top&cp={$sess}">{#MAIN_SETTINGS_EDIT_4#}</a></li>{/if} |
||||
</ul> |
||||
</li> |
||||
{/if} |
||||
{if check_permission('cache_clear')}<li><a href="javascript:void(0);" class="clearCache" title="{#MAIN_STAT_CLEAR_CACHE#}"><img src="{$tpl_dir}/images/icons/subTrash.png" alt="" /><span>{#MAIN_STAT_CLEAR_CACHE#}</span></a></li>{/if} |
||||
{* |
||||
<li><a href="#" title="{#MAIN_LOGIN_HELP#}"><img src="{$tpl_dir}/images/icons/help.png" alt="" /><span>{#MAIN_LOGIN_HELP#}</span></a></li> |
||||
*} |
||||
<li> |
||||
<a href="../" title="{#MAIN_LINK_SITE#}" target="_blank"><img src="{$tpl_dir}/images/icons/preview.png" alt="" /><span>{#MAIN_LINK_SITE#}</span></a> |
||||
</li> |
||||
<li><a href="admin.php?do=logout" class="ConfirmLogOut" title="{#MAIN_BUTTON_LOGOUT#}"><img src="{$tpl_dir}/images/icons/logout.png" alt="" /><span>{#MAIN_BUTTON_LOGOUT#}</span></a></li> |
||||
</ul> |
||||
</div> |
||||
<div class="fix"></div> |
||||
</div> |
||||
<div class="fix"></div> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<!-- Header --> |
||||
<div id="header" class="wrapper"> |
||||
<!-- <div class="logo"><a href="index.php" class="box"></a></div> --> |
||||
<div class="fix"></div> |
||||
</div> |
||||
<!-- Header --> |
||||
<div id="header" class="wrapper"> |
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
<!-- Wrapper --> |
||||
<div class="wrapper"> |
||||
<!-- Wrapper --> |
||||
<div class="wrapper"> |
||||
|
||||
<!-- Left navigation --> |
||||
<div class="leftNav {if $smarty.cookies.LeftMenu == "hidden"}hidden{/if}"> |
||||
{*<div class="logo"><a href="index.php" class="box"></a></div>*} |
||||
<!-- Left navigation --> |
||||
<div class="leftNav {if $smarty.cookies.LeftMenu == "hidden"}hidden{/if}"> |
||||
<ul id="menu"> |
||||
<li><a href="index.php" {if $smarty.request.do == ''}class="active collapse-close"{/if}><span>{#MAIN_LINK_HOME#}</span></a></li> |
||||
{$navi} |
||||
</ul> |
||||
</div> |
||||
|
||||
<ul id="menu"> |
||||
<li><a href="index.php" {if $smarty.request.do == ''}class="active collapse-close"{/if}><span>{#MAIN_LINK_HOME#}</span></a></li> |
||||
{$navi} |
||||
</ul> |
||||
</div> |
||||
<!-- Content --> |
||||
<div class="content" id="contentPage"> |
||||
{$content} |
||||
</div> |
||||
|
||||
<!-- Content --> |
||||
<div class="content" id="contentPage"> |
||||
{$content} |
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
|
||||
<!-- Footer --> |
||||
<div id="footer"> |
||||
<div class="wrapper"> |
||||
<span class="floatleft">{#oficial_site#}: {$smarty.const.APP_INFO}</span> |
||||
<span class="floatleft ml20">{#support#}: <a href="mailto:support@ave-cms.ru">support@ave-cms.ru</a></span> |
||||
<span class="floatright">{$smarty.const.APP_NAME} v{$smarty.const.APP_VERSION}</span> |
||||
<!-- Footer --> |
||||
<div id="footer"> |
||||
<div class="wrapper"> |
||||
<span class="floatleft">{#oficial_site#}: {$smarty.const.APP_INFO}</span> |
||||
<span class="floatleft ml20">{#support#}: <a href="mailto:support@ave-cms.ru">support@ave-cms.ru</a></span> |
||||
<span class="floatright">{$smarty.const.APP_NAME} v{$smarty.const.APP_VERSION}</span> |
||||
</div> |
||||
</div> |
||||
</div> |
||||
|
||||
<script type="text/javascript" src="{$ABS_PATH}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="{$ABS_PATH}admin/lang/{$smarty.session.admin_language}/scripts.js"></script> |
||||
<script src="{$tpl_dir}/js/main.js" type="text/javascript"></script> |
||||
|
||||
</body> |
||||
</body> |
||||
</html> |
@ -0,0 +1,136 @@
|
||||
<div class="title"> |
||||
<h5>{#RUBRIK_FIELDS_TEMPLATES_H2#}</h5> |
||||
</div> |
||||
|
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"><a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a></li> |
||||
<li><a href="index.php?do=modules&cp={$sess}">{#MODULES_SUB_TITLE#}</a></li> |
||||
<li><a href="index.php?do=modules&action=modedit&mod=fieldsmanager&moduleaction=1&cp={$sess}">Управление полями</a></li> |
||||
{if $params.id} |
||||
<li><strong>{#RUBRIK_FIELDS_EDIT_RUBRIC#}</strong> > {$params.field.rubric_title}</li> |
||||
<li><strong>{#RUBRIK_FIELDS_EDIT_FIELD#}</strong> > {$params.field.rubric_field_title}</li> |
||||
{/if} |
||||
<li><strong>{#RUBRIK_FIELDS_EDIT_TYPE#}</strong> > {$main.name} {if $params.id}(id: {$params.id}){/if}</li> |
||||
<li> |
||||
<strong class="code"> |
||||
{if $params.type == 'adm'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_ADM#} |
||||
{elseif $params.type == 'doc'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_DOC#}{ |
||||
elseif $params.type == 'req'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_REQ#} |
||||
{/if} |
||||
</strong> |
||||
</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
{if $code_text} |
||||
<form id="code_templ" method="post" action="index.php?do=rubs&action=ftsave&cp={$sess}" class="mainForm"> |
||||
|
||||
<div class="widget first"> |
||||
<div class="head"> |
||||
<h5 class="iFrames">{if $params.func == 'new'}{#RUBRIK_FIELDS_EDIT_TPL_CREAT#}{else}{#RUBRIK_FIELDS_EDIT_TPL_EDIT#}{/if}</h5> |
||||
</div> |
||||
|
||||
<div class="rowElem" style="padding: 0"> |
||||
<textarea id="code_text" name="code_text">{$code_text|escape}</textarea> |
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
<div class="rowElem"> |
||||
<button class="basicBtn SaveButton">{#RUBRIK_ALIAS_BUTT#}</button> |
||||
|
||||
<a href="javascript:void(0);" class="button redBtn Close">{#RUBRIK_BUTTON_TPL_CLOSE#}</a> |
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
</div> |
||||
|
||||
<input type="hidden" name="func" value="{$params.func}" /> |
||||
{if $params.id} |
||||
<input type="hidden" name="field_id" value="{$params.id}" /> |
||||
{/if} |
||||
<input type="hidden" name="field_name" value="{$params.fld}" /> |
||||
<input type="hidden" name="field_type" value="{$params.type}" /> |
||||
|
||||
</form> |
||||
|
||||
{include file="$codemirror_editor" conn_id="ftpl" textarea_id='code_text' ctrls='$("#code_templ").ajaxSubmit(sett_options);' height=400} |
||||
|
||||
<script language="javascript"> |
||||
$(document).ready(function(){ldelim} |
||||
|
||||
$(".SaveButton").on('click', function(event){ldelim} |
||||
event.preventDefault(); |
||||
$("#code_templ").ajaxSubmit({ldelim} |
||||
url: 'index.php?do=rubs&action=ftsave&cp={$sess}', |
||||
dataType: 'json', |
||||
beforeSubmit: function(){ldelim} |
||||
$.alerts._overlay('show'); |
||||
{rdelim}, |
||||
success: function(data){ldelim} |
||||
$.jGrowl(data['message'], {ldelim} |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
{rdelim}); |
||||
$.alerts._overlay('hide'); |
||||
|
||||
{if $params.func == 'new'} |
||||
var html = |
||||
'<a data-dialog="rft-{$params.id}" href="index.php?do=rubs&action=ftedit&rubric_id={$smarty.request.rubric_id}&id={$params.id}&fld={$params.fld}&type={$params.type}&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a>' |
||||
+ '<br />' |
||||
+ '<a href="index.php?do=rubs&action=ftdelete&rubric_id={$smarty.request.rubric_id}&id={$params.id}&fld={$params.fld}&type={$params.type}&cp={$sess}" class="link">{#RUBRIC_TMPLS_DELETE#}</a>' |
||||
; |
||||
|
||||
$('#{$params.type}_{$params.fld}_{$params.id}').html(html); |
||||
$('a.openDialog').off(); |
||||
AveAdmin.modalDialog(); |
||||
{/if} |
||||
|
||||
$('#ajax-dialog-rft-{if $params.id}{$params.id}{else}{$params.fld}{/if}').dialog('destroy').remove(); |
||||
{rdelim} |
||||
{rdelim}); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
$(".Close").on('click', function(event){ldelim} |
||||
event.preventDefault(); |
||||
$('#ajax-dialog-rft-{if $params.id}{$params.id}{else}{$params.fld}{/if}').dialog('destroy').remove(); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
{literal} |
||||
setTimeout(function(){editorftpl.refresh();}, 20); |
||||
{/literal} |
||||
|
||||
{rdelim}); |
||||
</script> |
||||
|
||||
{else} |
||||
|
||||
<div class="widget first"> |
||||
<div class="head"> |
||||
<h5 class="iFrames"> |
||||
{$main.name} - |
||||
{if $params.type == 'adm'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_ADM#} |
||||
{elseif $params.type == 'doc'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_DOC#}{ |
||||
elseif $params.type == 'req'} |
||||
{#RUBRIK_FIELDS_EDIT_TPL_REQ#} |
||||
{/if} |
||||
</h5> |
||||
</div> |
||||
</div> |
||||
|
||||
<ul class="messages first"> |
||||
<li class="highlight red"> |
||||
<strong>{#RUBRIK_FIELDS_EDIT_NO_TPL#}</strong> |
||||
</li> |
||||
</ul> |
||||
|
||||
{/if} |
@ -0,0 +1,142 @@
|
||||
<script language="Javascript" type="text/javascript"> |
||||
var sess = '{$sess}'; |
||||
</script> |
||||
|
||||
<div class="title"> |
||||
<h5>{#RUBRIK_FIELDS_TEMPLATES_H2#}</h5> |
||||
</div> |
||||
|
||||
<div class="widget" style="margin-top: 0px;"> |
||||
<div class="body"> |
||||
<ul style="list-style: square; margin-left:15px;"> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_T1#}</li> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_T2#}</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<table class="first tableButtons" cellpadding="0" cellspacing="0" width="100%" id="rubricButtons"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<tr> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=edit&Id={$smarty.request.rubric_id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FIELDS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=fieldsgroups&Id={$smarty.request.rubric_id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FGROUPS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=template&Id={$smarty.request.rubric_id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_TEMPLATES#}</a> |
||||
</td> |
||||
<td> |
||||
{if check_permission('rubric_code')} |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=code&Id={$smarty.request.rubric_id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_CODE#}</a> |
||||
{/if} |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=rules&Id={$smarty.request.rubric_id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_RULES#}</a> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"> |
||||
<a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a> |
||||
</li> |
||||
<li> |
||||
<a href="index.php?do=rubs&cp={$sess}">{#RUBRIK_SUB_TITLE#}</a> |
||||
</li> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_H1#}</li> |
||||
<li><strong class="code">{$rubric->rubric_title}</strong></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
{foreach from=$rubrics item=rubric} |
||||
<div class="widget"> |
||||
<div class="head"> |
||||
<h5>{$main.name} ({$main.id})</h5> |
||||
<div class="num"> |
||||
<a class="basicNum" href="index.php?do=rubs&action=ftlist&Id={$smarty.request.rubric_id}&cp={$sess}">{#RUBRIK_FIELDS_TEMPLATES_BACK#}</a> |
||||
</div> |
||||
</div> |
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm"> |
||||
<col width="10" /> |
||||
<col /> |
||||
<col width="100" /> |
||||
<col width="100" /> |
||||
<col width="100" /> |
||||
<col width="80" /> |
||||
<thead> |
||||
<tr> |
||||
<td colspan="1" rowspan="2">Id</td> |
||||
<td colspan="1" rowspan="2">{#RUBRIK_FIELDS_TEMPLATES_FNAME#}</td> |
||||
<td colspan="3" rowspan="1">{#RUBRIK_FIELDS_TEMPLATES_FTEMPL#}</td> |
||||
<td colspan="1" rowspan="2">{#RUBRIK_FIELDS_TEMPLATES_DB#}</td> |
||||
</tr> |
||||
<tr> |
||||
<td style="border-left: solid 1px #C7D6E6 !important;">{#RUBRIK_FIELDS_TEMPLATES_PANEL#}</td> |
||||
<td>{#RUBRIK_FIELDS_TEMPLATES_DOC#}</td> |
||||
<td>{#RUBRIK_FIELDS_TEMPLATES_REQ#}</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{foreach from=$rubric.fields item=field} |
||||
<tr class="center"> |
||||
<td align="center">{$field.id}</td> |
||||
<td><strong>{$field.title}</strong></td> |
||||
<td align="center" id="adm_{$main.id}_{$field.id}"> |
||||
{if $field.adm_main} |
||||
{if $field.adm_tpl} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftedit&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=adm&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
<br /> |
||||
<a href="index.php?do=rubs&action=ftdelete&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=adm&cp={$sess}" class="link">{#RUBRIC_TMPLS_DELETE#}</a> |
||||
{else} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftcreate&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=adm&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_CREAT#}</a> |
||||
{/if} |
||||
{else} |
||||
<small>{#RUBRIK_FIELDS_NO_TEMPLATES#}</small> |
||||
{/if} |
||||
</td> |
||||
<td align="center" id="doc_{$main.id}_{$field.id}"> |
||||
{if $field.doc_main} |
||||
{if $field.doc_tpl} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftedit&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=doc&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
<br /> |
||||
<a href="index.php?do=rubs&action=ftdelete&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=doc&cp={$sess}" class="link">{#RUBRIC_TMPLS_DELETE#}</a> |
||||
{else} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftcreate&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=doc&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_CREAT#}</a> |
||||
{/if} |
||||
{else} |
||||
<small>{#RUBRIK_FIELDS_NO_TEMPLATES#}</small> |
||||
{/if} |
||||
</td> |
||||
<td align="center" id="req_{$main.id}_{$field.id}"> |
||||
{if $field.req_main} |
||||
{if $field.req_tpl} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftedit&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=req&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
<br /> |
||||
<a href="index.php?do=rubs&action=ftdelete&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=req&cp={$sess}" class="link">{#RUBRIC_TMPLS_DELETE#}</a> |
||||
{else} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftcreate&rubric_id={$smarty.request.rubric_id}&id={$field.id}&fld={$main.id}&type=req&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_CREAT#}</a> |
||||
{/if} |
||||
{else} |
||||
<small>{#RUBRIK_FIELDS_NO_TEMPLATES#}</small> |
||||
{/if} |
||||
</td> |
||||
<td align="center"> |
||||
<a data-dialog="rft-{$field.id}" title="{#RUBRIK_FILED_TEMPLATE_H#}" href="index.php?do=rubs&action=field_template&field_id={$field.id}&rubric_id={$rubric.rubric_id}&cp={$sess}&pop=1&onlycontent=1" data-height="700" data-modal="true" data-title="{#RUBRIK_FILED_TEMPLATE_H#}" class="openDialog icon_sprite ico_template topleftDir"></a> |
||||
</td> |
||||
</tr> |
||||
{/foreach} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
{/foreach} |
||||
|
||||
{include file="$codemirror_connect"} |
@ -0,0 +1,136 @@
|
||||
<script language="Javascript" type="text/javascript"> |
||||
var sess = '{$sess}'; |
||||
</script> |
||||
|
||||
<div class="title"> |
||||
<h5>{#RUBRIK_FIELDS_TEMPLATES_H2#}</h5> |
||||
</div> |
||||
|
||||
<div class="widget" style="margin-top: 0px;"> |
||||
<div class="body"> |
||||
<ul style="list-style: square; margin-left:15px;"> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_T1#}</li> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_T2#}</li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<table class="first tableButtons" cellpadding="0" cellspacing="0" width="100%" id="rubricButtons"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<tr> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=edit&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FIELDS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=fieldsgroups&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FGROUPS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=template&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_TEMPLATES#}</a> |
||||
</td> |
||||
<td> |
||||
{if check_permission('rubric_code')} |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=code&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_CODE#}</a> |
||||
{/if} |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=rules&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_RULES#}</a> |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"> |
||||
<a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a> |
||||
</li> |
||||
<li> |
||||
<a href="index.php?do=rubs&cp={$sess}">{#RUBRIK_SUB_TITLE#}</a> |
||||
</li> |
||||
<li>{#RUBRIK_FIELDS_TEMPLATES_H1#}</li> |
||||
<li><strong class="code">{$rubric->rubric_title}</strong></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
<div class="widget"> |
||||
<div class="head"> |
||||
<h5>{#RUBRIK_FIELDS_TEMPLATES_LIST#}</h5> |
||||
</div> |
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic mainForm"> |
||||
|
||||
<col /> |
||||
<col width="100" /> |
||||
<col width="100" /> |
||||
<col width="100" /> |
||||
<col width="80" /> |
||||
<col width="100" /> |
||||
<col width="80" /> |
||||
<thead> |
||||
<tr> |
||||
|
||||
</tr> |
||||
|
||||
<tr> |
||||
<td colspan="1" rowspan="2">{#RUBRIK_FIELDS_TEMPLATES_FNAME#}</td> |
||||
<td colspan="1" rowspan="2">{#RUBRIK_FIELDS_TEMPLATES_FFUNC#}</td> |
||||
<td colspan="3" rowspan="1">{#RUBRIK_FIELDS_TEMPLATES_FTEMP#}</td> |
||||
</tr> |
||||
<tr> |
||||
<td style="border-left: solid 1px #C7D6E6 !important;">{#RUBRIK_FIELDS_TEMPLATES_PANEL#}</td> |
||||
<td>{#RUBRIK_FIELDS_TEMPLATES_DOC#}</td> |
||||
<td>{#RUBRIK_FIELDS_TEMPLATES_REQ#}</td> |
||||
</tr> |
||||
|
||||
</thead> |
||||
<tbody> |
||||
{foreach from=$fields item=field key=number} |
||||
{if in_array($field.id, $enable)} |
||||
<tr> |
||||
<td> |
||||
<strong><a class="link" href="index.php?do=rubs&action=ftshowfield&rubric_id={$smarty.request.Id}&type={$field.id}&cp={$sess}">{$field.name}</a></strong> |
||||
</td> |
||||
|
||||
<td class="date_text dgrey" align="center"> |
||||
{$field.id} |
||||
</td> |
||||
|
||||
<td align="center"> |
||||
{foreach from=$exists item=exist key=key} |
||||
{if $field.id == $key} |
||||
{if $exist.adm} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftempledit&rubric_id={$smarty.request.Id}&fld={$field.id}&type=adm&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
{/if} |
||||
{/if} |
||||
{/foreach} |
||||
</td> |
||||
<td align="center"> |
||||
{foreach from=$exists item=exist key=key} |
||||
{if $field.id == $key} |
||||
{if $exist.doc} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftempledit&rubric_id={$smarty.request.Id}&fld={$field.id}&type=doc&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
{/if} |
||||
{/if} |
||||
{/foreach} |
||||
</td> |
||||
<td align="center"> |
||||
{foreach from=$exists item=exist key=key} |
||||
{if $field.id == $key} |
||||
{if $exist.req} |
||||
<a data-dialog="rft-{$field.id}" href="index.php?do=rubs&action=ftempledit&rubric_id={$smarty.request.Id}&fld={$field.id}&type=req&cp={$sess}&pop=1&onlycontent=1" data-height="650" data-modal="true" class="openDialog">{#RUBRIC_TMPLS_EDIT#}</a> |
||||
{/if} |
||||
{/if} |
||||
{/foreach} |
||||
</td> |
||||
</tr> |
||||
{/if} |
||||
{/foreach} |
||||
</tbody> |
||||
</table> |
||||
</div> |
||||
|
||||
{include file="$codemirror_connect"} |
@ -0,0 +1,240 @@
|
||||
<script language="Javascript" type="text/javascript"> |
||||
var sess = '{$sess}'; |
||||
</script> |
||||
|
||||
<div class="title"> |
||||
<h5>{#RUBRIK_EDIT_RULES#}</h5> |
||||
</div> |
||||
|
||||
<div class="widget" style="margin-top: 0px;"> |
||||
<div class="body">{#RUBRIC_WARNING_TIP#}</div> |
||||
</div> |
||||
|
||||
<table class="first tableButtons" cellpadding="0" cellspacing="0" width="100%" id="rubricButtons"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<col width="20%"> |
||||
<tr> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=edit&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FIELDS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=ftlist&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FTEMPLATES#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=fieldsgroups&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_FGROUPS#}</a> |
||||
</td> |
||||
<td> |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=template&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_TEMPLATES#}</a> |
||||
</td> |
||||
<td> |
||||
{if check_permission('rubric_code')} |
||||
<a class="button basicBtn topBtn" href="index.php?do=rubs&action=code&Id={$smarty.request.Id|escape}&cp={$sess}">{#RUBRIC_TABLE_BTN_CODE#}</a> |
||||
{/if} |
||||
</td> |
||||
</tr> |
||||
</table> |
||||
|
||||
<div class="breadCrumbHolder module"> |
||||
<div class="breadCrumb module"> |
||||
<ul> |
||||
<li class="firstB"> |
||||
<a href="index.php" title="{#MAIN_PAGE#}">{#MAIN_PAGE#}</a> |
||||
</li> |
||||
<li> |
||||
<a href="index.php?do=rubs&cp={$sess}">{#RUBRIK_SUB_TITLE#}</a> |
||||
</li> |
||||
<li>{#RUBRIK_EDIT_FIELDS#}</li> |
||||
<li><strong class="code">{$rubric->rubric_title}</strong></li> |
||||
</ul> |
||||
</div> |
||||
</div> |
||||
|
||||
{if check_permission('rubric_edit') && check_permission('rubric_perms')} |
||||
<div class="widget first"> |
||||
<div class="head"> |
||||
<h5>{#RUBRIK_SET_PERMISSION#}</h5> |
||||
</div> |
||||
<div style="display: block;"> |
||||
<form id="rubperm" action="index.php?do=rubs&action=rules&Id={$smarty.request.Id|escape}&submit=saveperms&cp={$sess}" method="post" class="mainForm"> |
||||
<table cellpadding="0" cellspacing="0" width="100%" class="tableStatic"> |
||||
<col width="16%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<col width="12%"> |
||||
<thead> |
||||
<tr> |
||||
<td>{#RUBRIK_USER_GROUP#}</td> |
||||
<td align="center"> |
||||
{#RUBRIK_DOC_READ#} <a href="javascript:void(0);" class="topDir link" style="cursor: help;" title="{#RUBRIK_VIEW_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_ALL_PERMISSION#} <a href="javascript:void(0);" class="topDir link" style="cursor: help;" title="{#RUBRIK_ALL_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_CREATE_DOC#} <a href="javascript:void(0);" class="topDir link" style="cursor: help;" title="{#RUBRIK_DOC_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_CREATE_DOC_NOW#} <a href="javascript:void(0);" class="topDir link" style="cursor: help;" title="{#RUBRIK_DOC_NOW_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_EDIT_OWN#} <a href="javascript:void(0);" class="topDir link" style="cursor: help;" title="{#RUBRIK_OWN_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_EDIT_OTHER#} <a href="javascript:void(0);" class="topleftDir link" style="cursor: help;" title="{#RUBRIK_OTHER_TIP#}">[?]</a> |
||||
</td> |
||||
<td align="center"> |
||||
{#RUBRIK_EDIT_DELREV#} <a href="javascript:void(0);" class="topleftDir link" style="cursor: help;" title="{#RUBRIK_DELREV_TIP#}">[?]</a> |
||||
</td> |
||||
</tr> |
||||
</thead> |
||||
<tbody> |
||||
{foreach from=$groups item=group} |
||||
{assign var=doall value=$group->doall} |
||||
<tr> |
||||
<td>{$group->user_group_name|escape:html} </td> |
||||
<td align="center" {if in_array('docread', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
{if $group->doall_h==1} |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="docread" /> |
||||
<input class="check_perm" name="perm[{$group->user_group}][]" type="checkbox" value="docread" checked="checked" disabled="disabled" /> |
||||
{else} |
||||
<input class="check_perm" name="perm[{$group->user_group}][]" type="checkbox" value="docread"{if in_array('docread', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
{if $group->doall_h==1} |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="alles" /> |
||||
<input class="check_perm" name="perm[{$group->user_group}][]" type="checkbox" value="alles" checked="checked" disabled="disabled" /> |
||||
{else} |
||||
<input class="check_perm" name="perm[{$group->user_group}][]" type="checkbox" value="alles"{if in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('new', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
<input type="hidden" name="user_group[{$group->user_group}]" value="{$group->user_group}" /> |
||||
{if $group->doall_h==1} |
||||
<input class="check_perm" name="{$group->user_group}" type="checkbox" value="1"{$doall} /> |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="new" /> |
||||
{else} |
||||
<input class="check_perm new" id="new_{$group->user_group}" name="perm[{$group->user_group}][]" type="checkbox" value="new"{if in_array('new', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('newnow', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
<input type="hidden" name="user_group[{$group->user_group}]" value="{$group->user_group}" /> |
||||
{if $group->doall_h==1} |
||||
<input class="check_perm" name="{$group->user_group}" type="checkbox" value="1"{$doall} /> |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="newnow" /> |
||||
{else} |
||||
<input class="check_perm newnow" id="newnow_{$group->user_group}" name="perm[{$group->user_group}][]" type="checkbox" value="newnow"{if in_array('newnow', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('editown', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
{if $group->doall_h==1} |
||||
<input class="check_perm" name="{$group->user_group}" type="checkbox" value="1"{$doall} /> |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="editown" /> |
||||
{else} |
||||
<input class="check_perm editown" id="editown_{$group->user_group}" data-id="{$group->user_group}" name="perm[{$group->user_group}][]" type="checkbox" value="editown"{if in_array('editown', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('editall', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
{if $group->doall_h==1} |
||||
<input class="check_perm" name="{$group->user_group}" type="checkbox" value="1"{$doall} /> |
||||
{else} |
||||
<input class="check_perm editall" id="editall_{$group->user_group}" name="perm[{$group->user_group}][]" data-id="{$group->user_group}" type="checkbox" value="editall"{if in_array('editall', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
<td align="center" {if in_array('delrev', $group->permissions) || in_array('alles', $group->permissions)} class="yellow"{/if}> |
||||
{if $group->doall_h==1} |
||||
<input class="check_perm" name="{$group->user_group}" type="checkbox" value="1"{$doall} /> |
||||
<input type="hidden" name="perm[{$group->user_group}][]" value="delrev" /> |
||||
{else} |
||||
<input class="check_perm" name="perm[{$group->user_group}][]" type="checkbox" value="delrev"{if in_array('delrev', $group->permissions) || in_array('alles', $group->permissions)} checked="checked"{/if}{if $group->user_group==2} disabled="disabled"{/if} /> |
||||
{/if} |
||||
</td> |
||||
</tr> |
||||
{/foreach} |
||||
</tbody> |
||||
</table> |
||||
<div class="rowElem"> |
||||
<input type="submit" class="basicBtn" value="{#RUBRIK_BUTTON_PERM#}" /> |
||||
|
||||
<input type="submit" class="blackBtn SaveEditPerms" value="{#RUBRIK_BUTTON_TPL_NEXT#}" /> |
||||
</div> |
||||
</form> |
||||
</div> |
||||
</div> |
||||
{/if} |
||||
|
||||
<script language="javascript"> |
||||
$(document).ready(function(){ldelim} |
||||
|
||||
{literal} |
||||
|
||||
$(document).on('change', '#selall', function(event) { |
||||
event.preventDefault(); |
||||
if ($('#selall').is(':checked')) { |
||||
$('#FieldsList .checkbox').attr('checked','checked'); |
||||
$('#FieldsList .checkbox').addClass('jqTransformChecked'); |
||||
} else { |
||||
$('#FieldsList .checkbox').removeClass('jqTransformChecked'); |
||||
$('#FieldsList .checkbox').removeAttr('checked'); |
||||
} |
||||
}); |
||||
|
||||
$('.check_perm').on('change', function(event) { |
||||
event.preventDefault(); |
||||
if ($(this).is(':checked')) { |
||||
$(this).parent().parent('td').addClass('yellow'); |
||||
} else { |
||||
$(this).parent().parent('td').removeClass('yellow'); |
||||
} |
||||
}); |
||||
|
||||
{/literal} |
||||
|
||||
Mousetrap.bind(['ctrl+s', 'command+s'], function(event) {ldelim} |
||||
event.preventDefault(); |
||||
$("#rubperm").ajaxSubmit({ldelim} |
||||
url: 'index.php?do=rubs&action=rules&Id={$smarty.request.Id|escape}&submit=saveperms&cp={$sess}&ajax=1', |
||||
dataType: 'json', |
||||
beforeSubmit: function(){ldelim} |
||||
$.alerts._overlay('show'); |
||||
{rdelim}, |
||||
success: function(data){ldelim} |
||||
$.jGrowl(data['message'], {ldelim} |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
{rdelim}); |
||||
$.alerts._overlay('hide'); |
||||
{rdelim} |
||||
{rdelim}); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
$(".SaveEditPerms").click(function(event){ldelim} |
||||
event.preventDefault(); |
||||
$("#rubperm").ajaxSubmit({ldelim} |
||||
url: 'index.php?do=rubs&action=rules&Id={$smarty.request.Id|escape}&submit=saveperms&cp={$sess}&ajax=1', |
||||
dataType: 'json', |
||||
beforeSubmit: function(){ldelim} |
||||
$.alerts._overlay('show'); |
||||
{rdelim}, |
||||
success: function(data){ldelim} |
||||
$.jGrowl(data['message'], {ldelim} |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
{rdelim}); |
||||
$.alerts._overlay('hide'); |
||||
{rdelim} |
||||
{rdelim}); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
|
||||
{rdelim}); |
||||
</script> |
@ -0,0 +1,78 @@
|
||||
<div class="title"> |
||||
<h5>{#SETTINGS_FILE_EDIT_H#} {$file_name}</h5> |
||||
</div> |
||||
|
||||
<div class="widget"> |
||||
<div class="title"> |
||||
<h5>{#SETTINGS_FILE_CONTENT#} {$file_name}</h5> |
||||
</div> |
||||
|
||||
<form id="code_form" method="post" action="{$formaction}" class="mainForm"> |
||||
<div class="rowElem" style="padding: 0"> |
||||
<textarea id="code_text" name="code_text">{$template|escape}</textarea> |
||||
<div class="fix"></div> |
||||
</div> |
||||
|
||||
<div class="rowElem"> |
||||
<button type="submit" class="basicBtn">{#SETTINGS_BUTTON_SAVE#}</button> |
||||
{#SETTINGS_OR#} |
||||
<button class="blackBtn SaveEditFile">{#SETTINGS_BUTTON_SAVE_AJAX#}</button> |
||||
<div class="fix"></div> |
||||
</div> |
||||
</form> |
||||
|
||||
</div> |
||||
|
||||
<script language="Javascript" type="text/javascript"> |
||||
var sett_options = {ldelim} |
||||
url: '{$formaction}', |
||||
dataType: 'json', |
||||
data: {ldelim} ajax: '1' {rdelim}, |
||||
beforeSubmit: Request, |
||||
success: Response |
||||
{rdelim} |
||||
|
||||
function Request(){ldelim} |
||||
$.alerts._overlay('show'); |
||||
{rdelim} |
||||
|
||||
function Response(data){ldelim} |
||||
$.alerts._overlay('hide'); |
||||
$.jGrowl(data['message'], {ldelim} |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
{rdelim}); |
||||
{rdelim} |
||||
|
||||
$(document).ready(function(){ldelim} |
||||
|
||||
Mousetrap.bind(['ctrl+s', 'command+s'], function(e) {ldelim} |
||||
if (e.preventDefault) {ldelim} |
||||
e.preventDefault(); |
||||
{rdelim} else {ldelim} |
||||
// internet explorer |
||||
e.returnValue = false; |
||||
{rdelim} |
||||
$("#code_form").ajaxSubmit(sett_options); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
$(".SaveEditFile").click(function(e){ldelim} |
||||
if (e.preventDefault) {ldelim} |
||||
e.preventDefault(); |
||||
{rdelim} else {ldelim} |
||||
// internet explorer |
||||
e.returnValue = false; |
||||
{rdelim} |
||||
$("#code_form").ajaxSubmit(sett_options); |
||||
return false; |
||||
{rdelim}); |
||||
|
||||
{literal} |
||||
setTimeout(function(){editorfile.refresh();}, 20); |
||||
{/literal} |
||||
|
||||
{rdelim}); |
||||
</script> |
||||
|
||||
{include file="$codemirror_editor" conn_id="file" textarea_id='code_text' ctrls='$("#code_form").ajaxSubmit(sett_options);' height=450} |
@ -1,406 +1,497 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
*/ |
||||
|
||||
class AVE_Module |
||||
{ |
||||
/** |
||||
* Внутренние методы |
||||
*/ |
||||
|
||||
/** |
||||
* Метод, который обрабатывает все module.php и записывает как свойство класса списки модулей |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
*/ |
||||
function getModules() |
||||
{ |
||||
global $AVE_DB; |
||||
|
||||
$modules = array(); |
||||
|
||||
// Получаем из БД информацию о всех установленных модулях |
||||
$modules_db = $this->moduleListGet(); |
||||
class AVE_Module |
||||
{ |
||||
public $_modules = array(); |
||||
|
||||
// Определяем директорию, где хранятся модули |
||||
$d = dir(BASE_DIR . '/modules'); |
||||
function __construct() |
||||
{ |
||||
$this->_modules = $this->getModules(); |
||||
} |
||||
|
||||
// Циклически обрабатываем директории |
||||
while (false !== ($entry = $d->read())) |
||||
/** |
||||
* Метод, который обрабатывает все module.php и записывает как свойство класса списки модулей |
||||
*/ |
||||
function getModules() |
||||
{ |
||||
if (substr($entry, 0, 1) == '.') continue; |
||||
$modules = array(); |
||||
|
||||
// Получаем из БД информацию о всех установленных модулях |
||||
$modules_db = $this->moduleListGet(); |
||||
|
||||
$module_dir = $d->path . '/' . $entry; |
||||
if (!is_dir($module_dir)) continue; |
||||
// Определяем директорию, где хранятся модули |
||||
$d = dir(BASE_DIR . '/modules'); |
||||
|
||||
$modul = array(); |
||||
if (!(is_file($module_dir . '/module.php') && @include($module_dir . '/module.php'))) |
||||
// Циклически обрабатываем директории |
||||
while (false !== ($entry = $d->read())) |
||||
{ |
||||
// Если не удалось подключить основной файл модуля module.php - Фиксируем ошибку |
||||
$modules['errors'][] = $entry; |
||||
continue; |
||||
if (substr($entry, 0, 1) == '.') |
||||
continue; |
||||
|
||||
if (! is_dir(BASE_DIR . '/modules/' . $entry)) |
||||
continue; |
||||
|
||||
$AVE_Template = new AVE_Template(BASE_DIR . '/admin/templates'); |
||||
|
||||
$_no_lang_file = false; |
||||
|
||||
// Языковой файл |
||||
$lang_file = BASE_DIR . '/modules/'.$entry.'/lang/' . $_SESSION['user_language'] . '.txt'; |
||||
|
||||
// Отдаем смарти переменные |
||||
if (file_exists($lang_file)) |
||||
$AVE_Template->config_load($lang_file, 'name'); |
||||
else |
||||
$_no_lang_file = true; |
||||
|
||||
$module_dir = $d->path . '/' . $entry; |
||||
|
||||
if (! is_dir($module_dir)) |
||||
continue; |
||||
|
||||
$module = array(); |
||||
|
||||
if (! (is_file($module_dir . '/info.php') && @include($module_dir . '/info.php'))) |
||||
{ |
||||
// Если не удалось подключить основной файл модуля module.php - Фиксируем ошибку |
||||
$modules['errors'][] = $entry; |
||||
continue; |
||||
} |
||||
|
||||
$module['ModuleName'] = !$_no_lang_file |
||||
? $AVE_Template->get_config_vars('MODULE_NAME') |
||||
: 'No name'; |
||||
|
||||
$module['ModuleDescription'] = !$_no_lang_file |
||||
? $AVE_Template->get_config_vars('MODULE_DESCRIPTION') |
||||
: 'No description'; |
||||
|
||||
// Дополняем массив с данными модуля |
||||
$module['permission'] = check_permission('mod_'. $module['ModuleSysName']); |
||||
|
||||
// Установлен/Не установлен по системному имени |
||||
$row = isset($modules_db[$module['ModuleSysName']]) |
||||
? $modules_db[$module['ModuleSysName']] |
||||
: false; |
||||
|
||||
// установленные модули |
||||
if ($row) |
||||
{ |
||||
$module['status'] = $row->ModuleStatus; |
||||
$module['id'] = $row->Id; |
||||
$module['need_update'] = ($row->ModuleVersion != $module['ModuleVersion']); |
||||
$module['template'] = ($row->ModuleTemplate ? $row->ModuleTemplate : 0); |
||||
$module['ModuleVersion'] = $row->ModuleVersion; |
||||
} |
||||
// неустановленные модули |
||||
else |
||||
{ |
||||
$module['status'] = false; |
||||
$module['id'] = $module['ModuleSysName']; |
||||
$module['template'] = (! empty($module['ModuleTemplate']) ? $module['ModuleTemplate'] : ''); |
||||
} |
||||
|
||||
// записываем в массив |
||||
$modules[$module['ModuleSysName']] = $module; |
||||
|
||||
unset ($module); |
||||
} |
||||
|
||||
// Дополняем массив с данными модуля |
||||
$modul['permission'] = check_permission('mod_'. $modul['ModuleSysName']); |
||||
$row = isset($modules_db[$modul['ModuleName']]) ? $modules_db[$modul['ModuleName']] : false; |
||||
// Закрываем папку |
||||
$d->Close(); |
||||
|
||||
// установленные модули |
||||
if ($row) |
||||
{ |
||||
$modul['status'] = $row->ModuleStatus; |
||||
$modul['id'] = $row->Id; |
||||
$modul['need_update'] = ($row->ModuleVersion != $modul['ModuleVersion']); |
||||
$modul['ModuleVersion'] = $row->ModuleVersion; |
||||
$modul['template'] = ($row->ModuleTemplate ? $row->ModuleTemplate : 0); |
||||
} |
||||
// неустановленные модули |
||||
else |
||||
{ |
||||
$modul['status'] = false; |
||||
$modul['id'] = $modul['ModuleSysName']; |
||||
$modul['template'] = (!empty($modul['ModuleTemplate']) ? $modul['ModuleTemplate'] : ''); |
||||
} |
||||
// записываем в массив |
||||
$modules[$modul['ModuleSysName']] = $modul; |
||||
return $modules; |
||||
} |
||||
$d->Close(); |
||||
return $modules; |
||||
} |
||||
|
||||
/** |
||||
* Внешние методы |
||||
*/ |
||||
/** |
||||
* Метод, преданзначеный для выода модулей |
||||
* |
||||
*/ |
||||
function moduleList() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$assign = array(); // Массив для передачи в Smarty |
||||
$errors = array(); // Массив с ошибками |
||||
|
||||
// Получаем список всех шаблонов |
||||
$sql = $AVE_DB->Query(" |
||||
SELECT |
||||
Id, |
||||
template_title |
||||
FROM |
||||
" . PREFIX . "_templates |
||||
"); |
||||
|
||||
/** |
||||
* Метод, преданзначеный для выода модулей |
||||
* |
||||
*/ |
||||
function moduleList() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
while ($row = $sql->FetchRow()) |
||||
$assign['all_templates'][$row->Id] = htmlspecialchars($row->template_title, ENT_QUOTES); |
||||
|
||||
$assign = array(); // Массив для передачи в Smarty |
||||
$errors = array(); // Массив с ошибками |
||||
// Заголовок: Автор модуля |
||||
$author_title = $AVE_Template->get_config_vars('MODULES_AUTHOR'); |
||||
|
||||
// Получаем список всех шаблонов |
||||
$sql = $AVE_DB->Query(" |
||||
SELECT Id, template_title |
||||
FROM " . PREFIX . "_templates |
||||
"); |
||||
while ($row = $sql->FetchRow()) |
||||
{ |
||||
$assign['all_templates'][$row->Id] = htmlspecialchars($row->template_title, ENT_QUOTES); |
||||
} |
||||
// Получаем список всех модулей |
||||
$modules = $this->_modules; |
||||
|
||||
$author_title = $AVE_Template->get_config_vars('MODULES_AUTHOR'); |
||||
$modules = $this->getModules(); |
||||
foreach ($modules as $module) |
||||
{ |
||||
$module['info'] = $module['ModuleDescription'] . (!$module['ModuleAutor'] ? '<br /><br />' : "<br /><br /><strong>$author_title</strong><br />" . $module['ModuleAutor'] . "<br />") . '<br /><em>' . $module['ModuleCopyright'] . '</em>'; |
||||
// установленные модули |
||||
if ($module['status'] !== false) |
||||
{ |
||||
$installed_modules[$module['ModuleName']] = $module; |
||||
} |
||||
// неустановленные модули |
||||
else |
||||
foreach ($modules as $module) |
||||
{ |
||||
$not_installed_modules[$module['ModuleName']] = $module; |
||||
$module['info'] = $module['ModuleDescription'] . (! $module['ModuleAutor'] |
||||
? '<br /><br />' |
||||
: "<br /><br /><strong>$author_title</strong><br />" . $module['ModuleAutor'] . "<br />") . '<br /><em>' . $module['ModuleCopyright'] . '</em>'; |
||||
// установленные модули |
||||
if ($module['status'] !== false) |
||||
$installed_modules[$module['ModuleSysName']] = $module; |
||||
// неустановленные модули |
||||
else |
||||
$not_installed_modules[$module['ModuleSysName']] = $module; |
||||
} |
||||
} |
||||
!empty($installed_modules) ? ksort($installed_modules) : $installed_modules = ''; |
||||
!empty($not_installed_modules) ? ksort($not_installed_modules) : $not_installed_modules = ''; |
||||
|
||||
$assign['installed_modules'] = $installed_modules; |
||||
$assign['not_installed_modules'] = $not_installed_modules; |
||||
! empty($installed_modules) |
||||
? ksort($installed_modules) |
||||
: $installed_modules = ''; |
||||
|
||||
! empty($not_installed_modules) |
||||
? ksort($not_installed_modules) |
||||
: $not_installed_modules = ''; |
||||
|
||||
// Массив с ошибками |
||||
if(!empty($modules['errors'])){ |
||||
foreach ($modules['errors'] as $error) |
||||
$assign['installed_modules'] = $installed_modules; |
||||
$assign['not_installed_modules'] = $not_installed_modules; |
||||
|
||||
// Массив с ошибками |
||||
if (! empty($modules['errors'])) |
||||
{ |
||||
$assign['errors'][] = $AVE_Template->get_config_vars('MODULES_ERROR') . $error; |
||||
foreach ($modules['errors'] as $error) |
||||
{ |
||||
$assign['errors'][] = $AVE_Template->get_config_vars('MODULES_ERROR') . $error; |
||||
} |
||||
} |
||||
|
||||
// Передаем данные в шаблон и отображаем страницу со списком модулей |
||||
$AVE_Template->assign($assign); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('modules/modules.tpl')); |
||||
} |
||||
// Передаем данные в шаблон и отображаем страницу со списком модулей |
||||
$AVE_Template->assign($assign); |
||||
$AVE_Template->assign('content', $AVE_Template->fetch('modules/modules.tpl')); |
||||
} |
||||
|
||||
/** |
||||
* Метод, предназначенный для обновления в БД информации о шаблонах модулей |
||||
* |
||||
*/ |
||||
function moduleOptionsSave() |
||||
{ |
||||
global $AVE_DB; |
||||
|
||||
// Циклически обрабатываем массив с информацией о шаблонах модулей |
||||
foreach ($_POST['Template'] as $id => $template_id) |
||||
/** |
||||
* Метод получения списка модулей |
||||
* |
||||
* @param int $status статус возвращаемых модулей |
||||
* 1 - активные модули |
||||
* 0 - неактивные модули |
||||
* если не указано возвращает модули без учета статуса |
||||
* @return array |
||||
*/ |
||||
function moduleListGet($status = null) |
||||
{ |
||||
// Обновление информации о шаблоне модуля |
||||
$AVE_DB->Query(" |
||||
UPDATE " . PREFIX . "_module |
||||
SET ModuleTemplate = '" . (int)$template_id . "' |
||||
WHERE Id = '" . (int)$id . "' |
||||
global $AVE_DB; |
||||
|
||||
$modules = array(); |
||||
|
||||
// Условие, определяющее статус документа для запроса к БД |
||||
$where_status = ($status !== null) |
||||
? "WHERE ModuleStatus = '" . (int)$status . "'" |
||||
: ''; |
||||
|
||||
// Выполняем запрос к БД и получаем список документов, |
||||
// согласно статусу, либо все модули, если статус не указан |
||||
$sql = $AVE_DB->Query(" |
||||
SELECT |
||||
* |
||||
FROM |
||||
" . PREFIX . "_module |
||||
" . $where_status . " |
||||
ORDER BY |
||||
ModuleName ASC |
||||
"); |
||||
|
||||
while ($row = $sql->FetchRow()) |
||||
$modules[$row->ModuleSysName] = $row; |
||||
|
||||
// Возвращаем список модулей |
||||
return $modules; |
||||
} |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
|
||||
/** |
||||
* Метод, предназанченный для установки или переустановки модуля |
||||
* |
||||
*/ |
||||
function moduleInstall() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
// Получаем данные модуля |
||||
$modules = $this->getModules(); |
||||
$modul = $modules[MODULE_PATH]; |
||||
|
||||
// Удаляем информацию о модуле в таблице module |
||||
$AVE_DB->Query(" |
||||
DELETE |
||||
FROM " . PREFIX . "_module |
||||
WHERE ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
|
||||
// Определяем, имеет ли модуль возможность настройки в Панели управления |
||||
$modul['ModuleAdminEdit'] = (!empty($modul['ModuleAdminEdit'])) ? $modul['ModuleAdminEdit'] : 0; |
||||
|
||||
// Определяем, имеет ли модуль возможность смены шаблона |
||||
$modul['ModuleTemplate'] = ($modul['ModuleTemplate']) ? $modul['ModuleTemplate'] : 0; |
||||
|
||||
// Добавляем информацию о модуле в таблицу module |
||||
$AVE_DB->Query(" |
||||
INSERT " . PREFIX . "_module |
||||
SET |
||||
ModuleName = '" . $modul['ModuleName'] . "', |
||||
ModuleStatus = '1', |
||||
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
||||
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
||||
ModuleFunction = '" . $modul['ModuleFunction'] . "', |
||||
ModuleIsFunction = '" . $modul['ModuleIsFunction'] . "', |
||||
ModuleSysName = '" . MODULE_PATH . "', |
||||
ModuleVersion = '" . $modul['ModuleVersion'] . "', |
||||
ModuleTemplate = '" . $modul['ModuleTemplate'] . "', |
||||
ModuleAdminEdit = '" . $modul['ModuleAdminEdit'] . "' |
||||
"); |
||||
|
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_deinstall = array(); |
||||
$module_sql_install = array(); |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
if (is_file($sql_file) && @include($sql_file)) |
||||
/** |
||||
* Метод, предназначенный для обновления в БД информации о шаблонах модулей |
||||
* |
||||
*/ |
||||
function moduleOptionsSave() |
||||
{ |
||||
// Выполняем запросы удаления таблиц модуля |
||||
// из массива $module_sql_deinstall файла sql.php |
||||
foreach ($module_sql_deinstall as $sql) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
} |
||||
global $AVE_DB; |
||||
|
||||
// Выполняем запросы создания таблиц и данных модуля |
||||
// из массива $module_sql_install файла sql.php |
||||
foreach ($module_sql_install as $sql) |
||||
// Циклически обрабатываем массив с информацией о шаблонах модулей |
||||
foreach ($_POST['Template'] as $id => $template_id) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
// Обновление информации о шаблоне модуля |
||||
$AVE_DB->Query(" |
||||
UPDATE |
||||
" . PREFIX . "_module |
||||
SET |
||||
ModuleTemplate = '" . (int)$template_id . "' |
||||
WHERE |
||||
Id = '" . (int)$id . "' |
||||
"); |
||||
} |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
// Сохраняем системное сообщение в журнал |
||||
($_REQUEST['action'] == "reinstall") ? reportLog($AVE_Template->get_config_vars('MODULES_ACTION_REINSTALL') . ' (' . $modul['ModuleName'] . ')') : reportLog($AVE_Template->get_config_vars('MODULES_ACTION_INSTALL') . ' (' . $modul['ModuleName'] . ')'); |
||||
|
||||
// Выполняем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
/** |
||||
* Метод, предназанченный для установки или переустановки модуля |
||||
* |
||||
*/ |
||||
function moduleInstall() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
/** |
||||
* Метод, предназначенный для обновления модуля при увеличении номера версии модуля |
||||
* |
||||
*/ |
||||
function moduleUpdate() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
// Получаем данные модуля |
||||
$modules = $this->_modules; |
||||
|
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_update = array(); |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
$mod_file = BASE_DIR . '/modules/' . MODULE_PATH . '/module.php'; |
||||
if (file_exists($mod_file) && file_exists($sql_file)) |
||||
{ |
||||
include($mod_file); |
||||
include($sql_file); |
||||
// Выполняем запросы обновления модуля |
||||
// из массива $module_sql_update файла sql.php |
||||
foreach ($module_sql_update as $sql) |
||||
$modul = $modules[MODULE_PATH]; |
||||
|
||||
// Удаляем информацию о модуле в таблице module |
||||
$AVE_DB->Query(" |
||||
DELETE |
||||
FROM |
||||
" . PREFIX . "_module |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
|
||||
// Определяем, имеет ли модуль возможность настройки в Панели управления |
||||
$modul['ModuleAdminEdit'] = (!empty($modul['ModuleAdminEdit'])) |
||||
? $modul['ModuleAdminEdit'] |
||||
: 0; |
||||
|
||||
// Определяем, имеет ли модуль возможность смены шаблона |
||||
$modul['ModuleTemplate'] = ($modul['ModuleTemplate']) |
||||
? $modul['ModuleTemplate'] |
||||
: 0; |
||||
|
||||
// Добавляем информацию о модуле в таблицу module |
||||
$AVE_DB->Query(" |
||||
INSERT INTO |
||||
" . PREFIX . "_module |
||||
SET |
||||
ModuleName = '" . $modul['ModuleName'] . "', |
||||
ModuleStatus = '1', |
||||
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
||||
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
||||
ModuleFunction = '" . $modul['ModuleFunction'] . "', |
||||
ModuleIsFunction = '" . $modul['ModuleIsFunction'] . "', |
||||
ModuleSysName = '" . MODULE_PATH . "', |
||||
ModuleVersion = '" . $modul['ModuleVersion'] . "', |
||||
ModuleTemplate = '" . $modul['ModuleTemplate'] . "', |
||||
ModuleAdminEdit = '" . $modul['ModuleAdminEdit'] . "' |
||||
"); |
||||
|
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_deinstall = array(); |
||||
$module_sql_install = array(); |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
|
||||
if (is_file($sql_file) && @include($sql_file)) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
// Выполняем запросы удаления таблиц модуля |
||||
// из массива $module_sql_deinstall файла sql.php |
||||
foreach ($module_sql_deinstall as $sql) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
} |
||||
|
||||
// Выполняем запросы создания таблиц и данных модуля |
||||
// из массива $module_sql_install файла sql.php |
||||
foreach ($module_sql_install as $sql) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
} |
||||
} |
||||
// Сохраняем системное сообщение в журнал |
||||
($_REQUEST['action'] == "reinstall") |
||||
? reportLog($AVE_Template->get_config_vars('MODULES_ACTION_REINSTALL') . ' (' . $modul['ModuleName'] . ')') |
||||
: reportLog($AVE_Template->get_config_vars('MODULES_ACTION_INSTALL') . ' (' . $modul['ModuleName'] . ')'); |
||||
|
||||
// Выполняем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
// Обновляем модуль, если в нем не применяется (отсутствует) файл sql.php |
||||
elseif (file_exists($mod_file) && file_exists($sql_file) === false) |
||||
|
||||
/** |
||||
* Метод, предназначенный для обновления модуля при увеличении номера версии модуля |
||||
* |
||||
*/ |
||||
function moduleUpdate() |
||||
{ |
||||
include($mod_file); |
||||
$AVE_DB->Query(" |
||||
UPDATE " . PREFIX . "_module |
||||
SET |
||||
ModuleName = '" . $modul['ModuleName'] . "', |
||||
ModuleStatus = '1', |
||||
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
||||
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
||||
ModuleFunction = '" . $modul['ModuleFunction'] . "', |
||||
ModuleIsFunction = '" . $modul['ModuleIsFunction'] . "', |
||||
ModuleSysName = '" . MODULE_PATH . "', |
||||
ModuleVersion = '" . $modul['ModuleVersion'] . "', |
||||
ModuleTemplate = '" . $modul['ModuleTemplate'] . "', |
||||
ModuleAdminEdit = '" . $modul['ModuleAdminEdit'] . "' |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
} |
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog($AVE_Template->get_config_vars('MODULES_ACTION_UPDATE') . ' (' . MODULE_PATH . ')'); |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
/** |
||||
* Метод, предназанченный для удаление модуля |
||||
* |
||||
*/ |
||||
function moduleDelete() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_update = array(); |
||||
|
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_deinstall = array(); |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
if (is_file($sql_file) && @include($sql_file)) |
||||
{ |
||||
// Выполняем запросы удаления таблиц модуля |
||||
// из массива $module_sql_deinstall файла sql.php |
||||
foreach ($module_sql_deinstall as $sql) |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
|
||||
$mod_file = BASE_DIR . '/modules/' . MODULE_PATH . '/module.php'; |
||||
|
||||
if (file_exists($mod_file) && file_exists($sql_file)) |
||||
{ |
||||
include($mod_file); |
||||
include($sql_file); |
||||
// Выполняем запросы обновления модуля |
||||
// из массива $module_sql_update файла sql.php |
||||
foreach ($module_sql_update as $sql) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
} |
||||
} |
||||
// Обновляем модуль, если в нем не применяется (отсутствует) файл sql.php |
||||
elseif (file_exists($mod_file) && file_exists($sql_file) === false) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
include($mod_file); |
||||
|
||||
$AVE_DB->Query(" |
||||
UPDATE |
||||
" . PREFIX . "_module |
||||
SET |
||||
ModuleName = '" . $modul['ModuleName'] . "', |
||||
ModuleStatus = '1', |
||||
ModuleAveTag = '" . $modul['ModuleAveTag'] . "', |
||||
ModulePHPTag = '" . $modul['ModulePHPTag'] . "', |
||||
ModuleFunction = '" . $modul['ModuleFunction'] . "', |
||||
ModuleIsFunction = '" . $modul['ModuleIsFunction'] . "', |
||||
ModuleSysName = '" . MODULE_PATH . "', |
||||
ModuleVersion = '" . $modul['ModuleVersion'] . "', |
||||
ModuleTemplate = '" . $modul['ModuleTemplate'] . "', |
||||
ModuleAdminEdit = '" . $modul['ModuleAdminEdit'] . "' |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
} |
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog ($AVE_Template->get_config_vars('MODULES_ACTION_UPDATE') . ' (' . MODULE_PATH . ')'); |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
|
||||
// Удаляем информацию о модуле в таблице module |
||||
$AVE_DB->Query(" |
||||
DELETE |
||||
FROM " . PREFIX . "_module |
||||
WHERE ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
/** |
||||
* Метод, предназанченный для удаление модуля |
||||
* |
||||
*/ |
||||
function moduleDelete() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog($AVE_Template->get_config_vars('MODULES_ACTION_DELETE') .' (' . MODULE_PATH . ')'); |
||||
// Подключаем файл с запросами к БД для данного модуля |
||||
$module_sql_deinstall = array(); |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
$sql_file = BASE_DIR . '/modules/' . MODULE_PATH . '/sql.php'; |
||||
|
||||
/** |
||||
* Метод, предназначенный для отключения/включение модуля в Панели управления |
||||
* |
||||
*/ |
||||
function moduleStatusChange() |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$status = $AVE_DB->Query(" |
||||
SELECT ModuleName, ModuleStatus FROM " . PREFIX . "_module |
||||
WHERE ModuleSysName = '" . MODULE_PATH . "' |
||||
")->FetchRow(); |
||||
|
||||
$ModuleStatus = ($status->ModuleStatus == "0" || $status->ModuleStatus == NULL) ? "1" : "0"; |
||||
|
||||
// Выполняем запрос к БД на смену статуса модуля |
||||
$AVE_DB->Query(" |
||||
UPDATE " . PREFIX . "_module |
||||
SET |
||||
ModuleStatus = '".$ModuleStatus."' |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
|
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog((($ModuleStatus == "0") ? $AVE_Template->get_config_vars('MODULES_ACTION_OFFLINE') : $AVE_Template->get_config_vars('MODULES_ACTION_ONLINE')) . ' (' . $status->ModuleName . ')'); |
||||
|
||||
// Выполняем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
if (is_file($sql_file) && @include($sql_file)) |
||||
{ |
||||
// Выполняем запросы удаления таблиц модуля |
||||
// из массива $module_sql_deinstall файла sql.php |
||||
foreach ($module_sql_deinstall as $sql) |
||||
{ |
||||
$AVE_DB->Query(str_replace('CPPREFIX', PREFIX, $sql)); |
||||
} |
||||
} |
||||
|
||||
/** |
||||
* Метод получения списка модулей |
||||
* |
||||
* @param int $status статус возвращаемых модулей |
||||
* 1 - активные модули |
||||
* 0 - неактивные модули |
||||
* если не указано возвращает модули без учета статуса |
||||
* @return array |
||||
*/ |
||||
function moduleListGet($status = null) |
||||
{ |
||||
global $AVE_DB; |
||||
// Удаляем информацию о модуле в таблице module |
||||
$AVE_DB->Query(" |
||||
DELETE |
||||
FROM |
||||
" . PREFIX . "_module |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
|
||||
$modules = array(); |
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog ($AVE_Template->get_config_vars('MODULES_ACTION_DELETE') .' (' . MODULE_PATH . ')'); |
||||
|
||||
// Условие, определяющее статус документа для запроса к БД |
||||
$where_status = ($status !== null) ? "WHERE ModuleStatus = '" . (int)$status . "'" : ''; |
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
|
||||
// Выполняем запрос к БД и получаем список документов, |
||||
// согласно статусу, либо все модули, если статус не указан |
||||
$sql = $AVE_DB->Query(" |
||||
SELECT * FROM " . PREFIX . "_module |
||||
" . $where_status . " |
||||
ORDER BY ModuleName ASC |
||||
"); |
||||
while ($row = $sql->FetchRow()) |
||||
/** |
||||
* Метод, предназначенный для отключения/включение модуля в Панели управления |
||||
* |
||||
*/ |
||||
function moduleStatusChange() |
||||
{ |
||||
$modules[$row->ModuleName] = $row; |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$status = $AVE_DB->Query(" |
||||
SELECT |
||||
ModuleName, |
||||
ModuleStatus |
||||
FROM |
||||
" . PREFIX . "_module |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
")->FetchRow(); |
||||
|
||||
$ModuleStatus = ($status->ModuleStatus == "0" || $status->ModuleStatus == NULL) |
||||
? "1" |
||||
: "0"; |
||||
|
||||
// Выполняем запрос к БД на смену статуса модуля |
||||
$AVE_DB->Query(" |
||||
UPDATE |
||||
" . PREFIX . "_module |
||||
SET |
||||
ModuleStatus = '".$ModuleStatus."' |
||||
WHERE |
||||
ModuleSysName = '" . MODULE_PATH . "' |
||||
"); |
||||
|
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog ((($ModuleStatus == "0") |
||||
? $AVE_Template->get_config_vars('MODULES_ACTION_OFFLINE') |
||||
: $AVE_Template->get_config_vars('MODULES_ACTION_ONLINE')) . ' (' . $status->ModuleName . ')'); |
||||
|
||||
// Выполняем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
// Возвращаем список модулей |
||||
return $modules; |
||||
} |
||||
|
||||
function moduleRemove($dir) |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$directory = BASE_DIR . '/modules/' . $dir; |
||||
function moduleRemove($dir) |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$files = glob($directory . '*', GLOB_MARK); |
||||
foreach($files as $file){ |
||||
if(substr($file, -1) == '/') |
||||
moduleRemove($file); |
||||
else |
||||
unlink($file); |
||||
} |
||||
rrmdir($directory); |
||||
$directory = BASE_DIR . '/modules/' . $dir; |
||||
|
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog($AVE_Template->get_config_vars('MODULES_ACTION_REMOVE') . ' (' . $dir . ')'); |
||||
$files = glob($directory . '*', GLOB_MARK); |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
} |
||||
foreach ($files as $file) |
||||
{ |
||||
if(substr($file, -1) == '/') |
||||
moduleRemove($file); |
||||
else |
||||
unlink($file); |
||||
} |
||||
|
||||
rrmdir ($directory); |
||||
|
||||
// Сохраняем системное сообщение в журнал |
||||
reportLog ($AVE_Template->get_config_vars('MODULES_ACTION_REMOVE') . ' (' . $dir . ')'); |
||||
|
||||
// Выполянем обновление страницы со списком модулей |
||||
header('Location:index.php?do=modules&cp=' . SESSION); |
||||
exit; |
||||
} |
||||
} |
||||
?> |
@ -1,96 +0,0 @@
|
||||
.cascad3 { |
||||
position: relative; |
||||
} |
||||
|
||||
.cascad3_item { |
||||
display: inline-block; |
||||
margin: 3px; |
||||
width: 120px; |
||||
height: 226px; |
||||
background-color: rgba(255, 255, 255, 0.5); |
||||
border: solid 1px #eaeaea; |
||||
border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
-webkit-border-radius: 5px; |
||||
position: relative; |
||||
text-align: center; |
||||
} |
||||
|
||||
.cascad3_item:hover { |
||||
background-color: rgba(255, 255, 255, 1.0); |
||||
border: solid 1px rgba(234, 234, 234, 0.5); |
||||
-webkit-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1); |
||||
-moz-box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1); |
||||
box-shadow: 0 0 5px 2px rgba(0, 0, 0, 0.1); |
||||
} |
||||
|
||||
.cascad3_item:hover > .header { |
||||
background-color: rgba(210, 210, 210, 0.3); |
||||
} |
||||
|
||||
.cascad3_item .header { |
||||
background-color: rgba(210, 210, 210, 0.5); |
||||
height: 26px; |
||||
margin-bottom: 10px; |
||||
cursor: move; |
||||
border-radius: 5px 5px 0 0; |
||||
} |
||||
|
||||
.cascad3_item .image { |
||||
background-color: #fcfcfc; |
||||
border: solid 1px #eaeaea; |
||||
border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
-webkit-border-radius: 5px; |
||||
} |
||||
|
||||
.cascad3_item input { |
||||
display: inline-block; |
||||
width: 100px; |
||||
margin-top: 5px; |
||||
border-radius: 0 0 2px 2px; |
||||
border: 1px solid #eaeaea !important; |
||||
resize: none !important; |
||||
box-shadow: none !important; |
||||
-webkit-box-shadow: none !important; |
||||
-moz-box-shadow: none !important; |
||||
padding: 3px !important; |
||||
box-sizing: border-box !important; |
||||
-webkit-box-sizing: border-box !important; |
||||
-moz-box-sizing: border-box !important; |
||||
} |
||||
|
||||
.cascad3_item .view { |
||||
position: absolute; |
||||
top: 3px; |
||||
left: 3px; |
||||
cursor: pointer !important; |
||||
} |
||||
|
||||
.cascad3_item .delete { |
||||
position: absolute; |
||||
top: 3px; |
||||
right: 3px; |
||||
cursor: pointer !important; |
||||
} |
||||
|
||||
.cascad3_item .info { |
||||
position: absolute; |
||||
top: 30px; |
||||
right: 3px; |
||||
cursor: pointer !important; |
||||
} |
||||
|
||||
.cascad3_sortable > .ui-state-highlight { |
||||
display: inline-block; |
||||
margin: 5px; |
||||
width: 120px; |
||||
height: 200px; |
||||
background-color: rgba(255,255,255,0.5); !important; |
||||
border: solid 1px #eaeaea; |
||||
border-radius: 5px; |
||||
-moz-border-radius: 5px; |
||||
-webkit-border-radius: 5px; |
||||
position: relative; |
||||
text-align: center; |
||||
} |
@ -1,307 +0,0 @@
|
||||
<?php |
||||
|
||||
/** |
||||
* AVE.cms |
||||
* |
||||
* @package AVE.cms |
||||
* @version 3.x |
||||
* @filesource |
||||
* @copyright © 2007-2014 AVE.cms, http://www.ave-cms.ru |
||||
* |
||||
* @license GPL v.2 |
||||
*/ |
||||
|
||||
// Изображение (Каскад) |
||||
function get_field_image_multi_new_3inputs($field_value, $action, $field_id=0, $tpl='', $tpl_empty=0, &$maxlength=null, $document_fields=array(), $rubric_id=0, $default=null) |
||||
{ |
||||
|
||||
global $AVE_Template, $img_pixel; |
||||
|
||||
$fld_dir = dirname(__FILE__) . '/'; |
||||
$tpl_dir = $fld_dir . 'tpl/'; |
||||
$fld_name = basename($fld_dir); |
||||
|
||||
$lang_file = $fld_dir . 'lang/' . (defined('ACP') ? $_SESSION['admin_language'] : $_SESSION['user_language']) . '.txt'; |
||||
|
||||
$AVE_Template->config_load($lang_file, 'lang'); |
||||
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars()); |
||||
$AVE_Template->config_load($lang_file, 'admin'); |
||||
|
||||
$res = 0; |
||||
|
||||
$iniset_count = ini_get('max_file_uploads'); |
||||
|
||||
switch ($action) |
||||
{ |
||||
case 'edit': |
||||
|
||||
$items = array(); |
||||
$items = unserialize($field_value); |
||||
$image_items = array(); |
||||
|
||||
if($items != false){ |
||||
|
||||
foreach($items as $k => $v){ |
||||
$image_item = explode('|', $v); |
||||
|
||||
$image[$k]['url'] = $image_item[0]; |
||||
$image[$k]['thumb'] = ($image_item[0] != '') ? make_thumbnail(array('size' => 'f100x100', 'link' => $image_item[0])) : $img_pixel; |
||||
$image[$k]['desc'] = (isset($image_item[1])) ? htmlspecialchars($image_item[1], ENT_QUOTES) : ''; |
||||
$image[$k]['desc2'] = (isset($image_item[2])) ? htmlspecialchars($image_item[2], ENT_QUOTES) : ''; |
||||
$image[$k]['desc3'] = (isset($image_item[3])) ? htmlspecialchars($image_item[3], ENT_QUOTES) : ''; |
||||
} |
||||
|
||||
if (!empty($image)) { |
||||
$image_items = $image; |
||||
} |
||||
} |
||||
|
||||
$show_upload = true; |
||||
|
||||
if(preg_match("/%id/i", $default)) |
||||
{ |
||||
if ($_REQUEST['action'] != 'new') { |
||||
$path_upload = trim(@str_replace('%id', $_REQUEST['Id'], $default), '/'); |
||||
$show_upload = true; |
||||
} else { |
||||
$path_upload = (!empty($default)) ? trim($default, '/') : ''; |
||||
$show_upload = false; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
$path_upload = (!empty($default)) ? $default : ''; |
||||
$show_upload = true; |
||||
} |
||||
|
||||
$dir_upload = '/' . UPLOAD_DIR . '/' . ((!empty($path_upload)) ? $path_upload . '/' : ''); |
||||
|
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'admin'); |
||||
|
||||
$AVE_Template->assign('max_files', $AVE_Template->get_config_vars('max_f_f') . $iniset_count); |
||||
$AVE_Template->assign('dir_upload', $AVE_Template->get_config_vars('upl_dir') . $dir_upload); |
||||
$AVE_Template->assign('show_upload', $show_upload); |
||||
|
||||
$AVE_Template->assign('field_dir', $fld_name); |
||||
$AVE_Template->assign('images', $image_items); |
||||
$AVE_Template->assign('field_id', $field_id); |
||||
$AVE_Template->assign('doc_id', (int)$_REQUEST['Id']); |
||||
return $AVE_Template->fetch($tpl_file); |
||||
break; |
||||
|
||||
case 'doc': |
||||
|
||||
$items = (isset($field_value)) ? unserialize($field_value) : array(); |
||||
|
||||
$res = array(); |
||||
|
||||
if($items != false){ |
||||
foreach($items as $image_item) |
||||
{ |
||||
$image_item = clean_php($image_item); |
||||
$field_param = explode('|', $image_item); |
||||
if($image_item){ |
||||
if ($tpl_empty) |
||||
{ |
||||
$image_item = $field_param; |
||||
} |
||||
else |
||||
{ |
||||
$image_item = preg_replace_callback( |
||||
'/\[tag:parametr:(\d+)\]/i', |
||||
function($data) use($field_param) |
||||
{ |
||||
return $field_param[(int)$data[1]]; |
||||
}, |
||||
$tpl |
||||
); |
||||
|
||||
$image_item = preg_replace_callback( |
||||
'/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', |
||||
create_function( |
||||
'$m', |
||||
'return watermarks(\'$m[1]\', \'$m[2]\', $m[3]);' |
||||
), |
||||
$image_item |
||||
); |
||||
|
||||
$image_item = preg_replace_callback('/\[tag:([r|c|f|t|s]\d+x\d+r*):(.+?)]/', 'callback_make_thumbnail', $image_item); |
||||
} |
||||
} |
||||
$res[] = $image_item; |
||||
} |
||||
} |
||||
|
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'doc'); |
||||
|
||||
if($tpl_empty && $tpl_file){ |
||||
|
||||
$AVE_Template->assign('field_id', $field_id); |
||||
$AVE_Template->assign('field_value', $res); |
||||
$AVE_Template->assign('field_count', count($res)); |
||||
$AVE_Template->assign('rubric_id', $rubric_id); |
||||
$AVE_Template->assign('default', $default); |
||||
|
||||
return $AVE_Template->fetch($tpl_file); |
||||
} |
||||
return (!empty($res)) ? implode(PHP_EOL, $res) : $tpl; |
||||
break; |
||||
|
||||
case 'req': |
||||
$items = unserialize($field_value); |
||||
|
||||
$res = ''; |
||||
|
||||
if($items != false) { |
||||
foreach($items as $image_item) |
||||
{ |
||||
$image_item = clean_php($image_item); |
||||
$field_param = explode('|', $image_item); |
||||
if($image_item){ |
||||
if ($tpl_empty) |
||||
{ |
||||
$image_item = $field_param; |
||||
} |
||||
else |
||||
{ |
||||
$image_item = preg_replace_callback( |
||||
'/\[tag:parametr:(\d+)\]/i', |
||||
function($data) use($field_param) |
||||
{ |
||||
return $field_param[(int)$data[1]]; |
||||
}, |
||||
$tpl |
||||
); |
||||
|
||||
$image_item = preg_replace_callback( |
||||
'/\[tag:watermark:(.+?):([a-zA-Z]+):([0-9]+)\]/', |
||||
create_function( |
||||
'$m', |
||||
'return watermarks(\'$m[1]\', \'$m[2]\', $m[3]);' |
||||
), |
||||
$image_item |
||||
); |
||||
|
||||
$image_item = preg_replace_callback('/\[tag:([r|c|f]\d+x\d+r*):(.+?)]/', 'callback_make_thumbnail', $image_item); |
||||
} |
||||
} |
||||
$res[] = $image_item; |
||||
} |
||||
} |
||||
|
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'req'); |
||||
|
||||
if($tpl_empty && $tpl_file){ |
||||
|
||||
$AVE_Template->assign('field_id', $field_id); |
||||
$AVE_Template->assign('field_value', $res); |
||||
$AVE_Template->assign('field_count', count($res)); |
||||
$AVE_Template->assign('rubric_id', $rubric_id); |
||||
$AVE_Template->assign('default', $default); |
||||
|
||||
return $AVE_Template->fetch($tpl_file); |
||||
} |
||||
|
||||
return (!empty($res)) ? implode(PHP_EOL, $res) : $tpl; |
||||
break; |
||||
|
||||
case 'save': |
||||
foreach ($field_value as $v) |
||||
{ |
||||
if(!empty($v['url'])){ |
||||
$field_value_new[] = $v['url'] . '|' . $v['descr'] . '|' . $v['descr2'] . '|' . $v['descr3']; |
||||
} |
||||
} |
||||
if (isset($field_value_new)) { |
||||
return @serialize($field_value_new); |
||||
} else { |
||||
return $field_value_new = ''; |
||||
} |
||||
|
||||
break; |
||||
|
||||
case 'name' : |
||||
return $AVE_Template->get_config_vars('name'); |
||||
break; |
||||
|
||||
case 'upload': |
||||
$error = false; |
||||
|
||||
$files_unput = 'cascad3_files'.'_'.$_REQUEST['field_id'].'_'.$_REQUEST['doc_id']; |
||||
|
||||
if(preg_match("/%id/i", $default)) |
||||
{ |
||||
$path = trim(@str_replace('%id', $_REQUEST['doc_id'], $default), '/'); |
||||
} |
||||
else |
||||
{ |
||||
$path = (!empty($default)) ? $default : ''; |
||||
} |
||||
|
||||
function getExtension($file) |
||||
{ |
||||
$file = pathinfo($file); |
||||
return $file['extension']; |
||||
} |
||||
|
||||
$valid_formats = array("jpg", "png", "gif", "bmp","jpeg"); |
||||
|
||||
$dir = '/' . UPLOAD_DIR . '/' . ((!empty($path)) ? $path . '/' : ''); |
||||
$dir_abs = BASE_DIR . $dir; |
||||
|
||||
if (!is_dir($dir_abs)) @mkdir($dir_abs, 0777, true); |
||||
|
||||
foreach ($_FILES[$files_unput]['name'] as $name => $value) { |
||||
|
||||
$filename = strtolower(stripslashes(prepare_url($_FILES[$files_unput]['name'][$name]))); |
||||
//$size = filesize($_FILES[$files_unput]['tmp_name'][$name]); |
||||
|
||||
$ext = getExtension($filename); |
||||
$ext = strtolower($ext); |
||||
|
||||
if(in_array($ext, $valid_formats)) |
||||
{ |
||||
if (file_exists($dir_abs . $filename)) |
||||
{ |
||||
$filename = rand(1000, 9999) . '_' . $filename; |
||||
} |
||||
|
||||
if (@move_uploaded_file($_FILES[$files_unput]['tmp_name'][$name], $dir_abs . $filename)) { |
||||
$new_files[] = $filename; |
||||
$error = false; |
||||
} else { |
||||
$error = true; |
||||
} |
||||
} |
||||
else |
||||
{ |
||||
$error = true; |
||||
@unlink($_FILES[$files_unput]['tmp_name'][$name]); |
||||
} |
||||
} |
||||
if ($error !== true) { |
||||
echo json_encode(array( |
||||
'files' => $new_files, |
||||
'dir' => $dir, |
||||
'respons' => 'succes', |
||||
'message' => $AVE_Template->get_config_vars('resp_s_m'), |
||||
'header' => $AVE_Template->get_config_vars('resp_s_h'), |
||||
'theme' => 'accept' |
||||
) |
||||
); |
||||
} |
||||
else |
||||
{ |
||||
echo json_encode(array( |
||||
'respons' => 'error', |
||||
'message' => $AVE_Template->get_config_vars('resp_e_m'), |
||||
'header' => $AVE_Template->get_config_vars('resp_e_h'), |
||||
'theme' => 'error' |
||||
) |
||||
); |
||||
} |
||||
exit; |
||||
} |
||||
|
||||
return ($res ? $res : $field_value); |
||||
} |
@ -1,235 +0,0 @@
|
||||
var Cascad3 = { |
||||
|
||||
init: false, |
||||
|
||||
init: function() { |
||||
if (this.initialized) return; |
||||
this.initialized = true; |
||||
|
||||
this.cascad3(); |
||||
}, |
||||
|
||||
cascad3: function() { |
||||
this.cascad3_sortable(); |
||||
this.cascad3_del_item(); |
||||
this.cascad3_del_all_item(); |
||||
this.cascad3_add_single(); |
||||
this.cascad3_add_folder(); |
||||
this.cascad3_upload_files(); |
||||
this.cascad3_click_upload(); |
||||
}, |
||||
|
||||
cascad3_update: function() { |
||||
this.cascad3_maxid(); |
||||
this.cascad3_del_item(); |
||||
AveAdmin.fancy_box(); |
||||
AveAdmin.tooltip(); |
||||
}, |
||||
|
||||
cascad3_maxid: function(id, doc) { |
||||
var maxid = 1; |
||||
$('#cascad3_' + doc + '_' + id).children('.cascad3_sortable').children('.cascad3_item').each(function() { |
||||
maxid = Math.max(maxid, parseInt($(this).attr("data-id")) + 1); |
||||
}); |
||||
return maxid; |
||||
}, |
||||
|
||||
cascad3_del_item: function() { |
||||
$('.cascad3_item .delete').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var id = $(this).attr('data-id'); |
||||
jConfirm( |
||||
del_conf, |
||||
del_head, |
||||
function(b) { |
||||
if (b) { |
||||
$('#cascad3_image_' + id).remove(); |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_del_all_item: function() { |
||||
$('.cascad3_del_all').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
jConfirm( |
||||
del_all_c, |
||||
del_all_h, |
||||
function(b) { |
||||
if (b) { |
||||
$('#cascad3_' + d_id + '_' + c_id).children('.cascad3_sortable').children('.cascad3_item').each(function() { |
||||
$(this).remove(); |
||||
}); |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_upload_files: function() { |
||||
$('.cascad3_upload').on('change', function(event) { |
||||
|
||||
var cascad3_input = $(this); |
||||
|
||||
event.preventDefault(); |
||||
|
||||
if (cascad3_input.val() == '') { |
||||
return false; |
||||
} |
||||
|
||||
var files_input = this.files.length; |
||||
var max_files = cascad3_input.attr("data-max-files"); |
||||
|
||||
if (files_input > max_files) { |
||||
$.jGrowl(max_f_t, { |
||||
header: max_f_h, |
||||
theme: 'error' |
||||
}); |
||||
|
||||
cascad3_input.replaceWith(cascad3_input.val('').clone(true)); |
||||
|
||||
return false; |
||||
} |
||||
|
||||
var cid = $(this).parent('.cascad3').attr("data-id"); |
||||
var did = $(this).parent('.cascad3').attr("data-doc"); |
||||
var rid = $(this).parent('.cascad3').attr("data-rubric"); |
||||
|
||||
$('#formDoc').ajaxSubmit({ |
||||
url: 'index.php?do=fields', |
||||
data: { |
||||
"field_id": cid, |
||||
"rubric_id": rid, |
||||
"doc_id": did, |
||||
"field": 'image_multi_new_3inputs', |
||||
"type": 'upload' |
||||
}, |
||||
beforeSend: function() { |
||||
$.alerts._overlay('show'); |
||||
}, |
||||
dataType: "json", |
||||
success: function(data) { |
||||
if (data['respons'] == 'succes') { |
||||
for (var p = 0, max = data.files.length; p < max; p++) { |
||||
iid = Cascad3.cascad3_maxid(cid, did); |
||||
var field_value = data['dir'] + data.files[p]; |
||||
var img_path = '../index.php?thumb=' + field_value + '&mode=f&width=128&height=128'; |
||||
$('#cascad3_' + did + '_' + cid + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + cid + '_' + did + '_' + iid + '" data-id="' + iid + '" doc=id="' + did + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + cid + '_' + did + '_' + iid + '" href="' + field_value + '" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + cid + '_' + did + '_' + iid + '"></a>' + |
||||
'<span class="topDir icon_sprite ico_info info" title="' + field_value + '"></span>' + |
||||
'<input type="hidden" value="' + field_value + '" name="feld[' + cid + '][' + iid + '][url]" id="image__' + cid + '_' + did + '_' + iid + '">' + |
||||
'<img id="preview__' + cid + '_' + did + '_' + iid + '" src="' + img_path + '" onclick="browse_uploads(\'image__' + cid + '_' + did + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr]" placeholder="' + place + ' 1" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr2]" placeholder="' + place + ' 2" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr3]" placeholder="' + place + ' 3" value = ""/>' + |
||||
'</div>' |
||||
); |
||||
$.alerts._overlay('hide'); |
||||
Cascad3.cascad3_update(); |
||||
} |
||||
} |
||||
$.jGrowl(data['message'], { |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
}); |
||||
cascad3_input.replaceWith(cascad3_input = cascad3_input.clone(true)); |
||||
cascad3_input.val(); |
||||
} |
||||
}); |
||||
return false; |
||||
}); |
||||
}, |
||||
|
||||
cascad3_click_upload: function() { |
||||
$('.cascad3_upload_local').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
$('.cascad3_upload_field_' + c_id + '_' + d_id).trigger('click'); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_add_single: function() { |
||||
$('.cascad3_add_single').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
var iid = Cascad3.cascad3_maxid(c_id, d_id); |
||||
$('#cascad3_' + d_id + '_' + c_id + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + c_id + '_' + d_id + '_' + iid + '" data-id="' + iid + '" data-doc="' + d_id + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + c_id + '_' + d_id + '_' + iid + '" href="" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + c_id + '_' + d_id + '_' + iid + '"></a>' + |
||||
'<input type="hidden" value="" name="feld[' + c_id + '][' + iid + '][url]" id="image__' + c_id + '_' + d_id + '_' + iid + '">' + |
||||
'<img id="preview__' + c_id + '_' + d_id + '_' + iid + '" src="' + blank + '" onclick="browse_uploads(\'image__' + c_id + '_' + d_id + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<input class="mousetrap" name="feld[' + c_id + '][' + iid + '][descr]" placeholder="' + place + ' 1" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + c_id + '][' + iid + '][descr2]" placeholder="' + place + ' 2" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + c_id + '][' + iid + '][descr3]" placeholder="' + place + ' 3" value = ""/>' + |
||||
'</div>' |
||||
); |
||||
browse_uploads('image__' + c_id + '_' + d_id + '_' + iid + ''); |
||||
Cascad3.cascad3_update(); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_sortable: function() { |
||||
$('.cascad3_sortable').sortable({ |
||||
handle: ".header", |
||||
placeholder: "ui-state-highlight grey_bg" |
||||
}); |
||||
//$(".cascad3").disableSelection();
|
||||
}, |
||||
|
||||
cascad3_add_folder: function() { |
||||
$('.cascad3_add_folder').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
browse_dirs("cascad3__" + c_id + '_' + d_id); |
||||
}); |
||||
} |
||||
}; |
||||
|
||||
$(document).ready(function() { |
||||
Cascad3.init(); |
||||
|
||||
$.fn.myPlugin = function cascad3_add_items(dir, cid, did) { |
||||
|
||||
$.ajax({ |
||||
url: ave_path + 'admin/index.php?do=docs&action=image_import&ajax=run', |
||||
data: { |
||||
"path": dir |
||||
}, |
||||
dataType: "json", |
||||
success: function(data) { |
||||
$.alerts._overlay('hide'); |
||||
for (var p = 0, max = data.respons.length; p < max; p++) { |
||||
var iid = Cascad3.cascad3_maxid(cid, did); |
||||
var field_value = dir + data.respons[p]; |
||||
var img_path = '../index.php?thumb=' + field_value + '&mode=f&width=128&height=128'; |
||||
$('#cascad3_' + did + '_' + cid + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + cid + '_' + did + '_' + iid + '" data-id="' + iid + '" doc=id="' + did + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + cid + '_' + did + '_' + iid + '" href="' + field_value + '" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + cid + '_' + did + '_' + iid + '"></a>' + |
||||
'<span class="topDir icon_sprite ico_info info" title="' + field_value + '"></span>' + |
||||
'<input type="hidden" value="' + field_value + '" name="feld[' + cid + '][' + iid + '][url]" id="image__' + cid + '_' + did + '_' + iid + '">' + |
||||
'<img id="preview__' + cid + '_' + did + '_' + iid + '" src="' + img_path + '" onclick="browse_uploads(\'image__' + cid + '_' + did + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr]" placeholder="' + place + ' 1" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr2]" placeholder="' + place + ' 2" value = ""/>' + |
||||
'<input class="mousetrap" name="feld[' + cid + '][' + iid + '][descr3]" placeholder="' + place + ' 3" value = ""/>' + |
||||
'</div>' |
||||
); |
||||
Cascad3.cascad3_update(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
}); |
@ -1,231 +0,0 @@
|
||||
var Cascad3 = { |
||||
|
||||
init: false, |
||||
|
||||
init: function() { |
||||
if (this.initialized) return; |
||||
this.initialized = true; |
||||
|
||||
this.cascad3(); |
||||
}, |
||||
|
||||
cascad3: function() { |
||||
this.cascad3_sortable(); |
||||
this.cascad3_del_item(); |
||||
this.cascad3_del_all_item(); |
||||
this.cascad3_add_single(); |
||||
this.cascad3_add_folder(); |
||||
this.cascad3_upload_files(); |
||||
this.cascad3_click_upload(); |
||||
}, |
||||
|
||||
cascad3_update: function() { |
||||
this.cascad3_maxid(); |
||||
this.cascad3_del_item(); |
||||
AveAdmin.fancy_box(); |
||||
AveAdmin.tooltip(); |
||||
}, |
||||
|
||||
cascad3_maxid: function(id, doc) { |
||||
var maxid = 1; |
||||
$('#cascad3_' + doc + '_' + id).children('.cascad3_sortable').children('.cascad3_item').each(function() { |
||||
maxid = Math.max(maxid, parseInt($(this).attr("data-id")) + 1); |
||||
}); |
||||
return maxid; |
||||
}, |
||||
|
||||
cascad3_del_item: function() { |
||||
$('.cascad3_item .delete').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var id = $(this).attr('data-id'); |
||||
jConfirm( |
||||
del_conf, |
||||
del_head, |
||||
function(b) { |
||||
if (b) { |
||||
$('#cascad3_image_' + id).remove(); |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_del_all_item: function() { |
||||
$('.cascad3_del_all').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
jConfirm( |
||||
del_all_c, |
||||
del_all_h, |
||||
function(b) { |
||||
if (b) { |
||||
$('#cascad3_' + d_id + '_' + c_id).children('.cascad3_sortable').children('.cascad3_item').each(function() { |
||||
$(this).remove(); |
||||
}); |
||||
} |
||||
} |
||||
); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_upload_files: function() { |
||||
$('.cascad3_upload').on('change', function(event) { |
||||
|
||||
event.preventDefault(); |
||||
|
||||
var cascad3_input = $(this); |
||||
|
||||
event.preventDefault(); |
||||
|
||||
if (cascad3_input.val() == '') { |
||||
return false; |
||||
} |
||||
|
||||
var files_input = this.files.length; |
||||
var max_files = cascad3_input.attr("data-max-files"); |
||||
|
||||
if (files_input > max_files) { |
||||
$.jGrowl(max_f_t, { |
||||
header: max_f_h, |
||||
theme: 'error' |
||||
}); |
||||
|
||||
cascad3_input.replaceWith(cascad3_input.val('').clone(true)); |
||||
|
||||
return false; |
||||
} |
||||
|
||||
var cid = $(this).parent('.cascad3').attr("data-id"); |
||||
var did = $(this).parent('.cascad3').attr("data-doc"); |
||||
var rid = $(this).parent('.cascad3').attr("data-rubric"); |
||||
|
||||
$('#docmanager_edit').ajaxSubmit({ |
||||
url: 'index.php?do=fields', |
||||
data: { |
||||
"field_id": cid, |
||||
"rubric_id": rid, |
||||
"doc_id": did, |
||||
"field": 'image_multi_new_3inputs', |
||||
"type": 'upload' |
||||
}, |
||||
beforeSend: function() { |
||||
$.alerts._overlay('show'); |
||||
}, |
||||
dataType: "json", |
||||
success: function(data) { |
||||
if (data['respons'] == 'succes') { |
||||
for (var p = 0, max = data.files.length; p < max; p++) { |
||||
iid = Cascad3.cascad3_maxid(cid, did); |
||||
var field_value = data['dir'] + data.files[p]; |
||||
var img_path = '../index.php?thumb=' + field_value + '&mode=f&width=128&height=128'; |
||||
$('#cascad3_' + did + '_' + cid + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + cid + '_' + did + '_' + iid + '" data-id="' + iid + '" doc=id="' + did + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + cid + '_' + did + '_' + iid + '" href="' + field_value + '" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + cid + '_' + did + '_' + iid + '"></a>' + |
||||
'<span class="topDir icon_sprite ico_info info" title="' + field_value + '"></span>' + |
||||
'<input type="hidden" value="' + field_value + '" name="data[' + did + '][feld][' + cid + '][' + iid + '][url]" id="image__' + cid + '_' + did + '_' + iid + '">' + |
||||
'<img id="preview__' + cid + '_' + did + '_' + iid + '" src="' + img_path + '" onclick="browse_uploads(\'image__' + cid + '_' + did + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<textarea class="mousetrap" name="data[' + did + '][feld][' + cid + '][' + iid + '][descr]" placeholder="' + place + '"></textarea>' + |
||||
'</div>' |
||||
); |
||||
$.alerts._overlay('hide'); |
||||
Cascad3.cascad3_update(); |
||||
} |
||||
} |
||||
$.jGrowl(data['message'], { |
||||
header: data['header'], |
||||
theme: data['theme'] |
||||
}); |
||||
cascad3_input.replaceWith(cascad3_input = cascad3_input.clone(true)); |
||||
cascad3_input.val(); |
||||
} |
||||
}); |
||||
return false; |
||||
}); |
||||
}, |
||||
|
||||
cascad3_click_upload: function() { |
||||
$('.cascad3_upload_local').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
$('.cascad3_upload_field_' + c_id + '_' + d_id).trigger('click'); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_add_single: function() { |
||||
$('.cascad3_add_single').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
var iid = Cascad3.cascad3_maxid(c_id, d_id); |
||||
$('#cascad3_' + d_id + '_' + c_id + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + c_id + '_' + d_id + '_' + iid + '" data-id="' + iid + '" data-doc="' + d_id + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + c_id + '_' + d_id + '_' + iid + '" href="" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + c_id + '_' + d_id + '_' + iid + '"></a>' + |
||||
'<input type="hidden" value="" name="data[' + d_id + '][feld][' + c_id + '][' + iid + '][url]" id="image__' + c_id + '_' + d_id + '_' + iid + '">' + |
||||
'<img id="preview__' + c_id + '_' + d_id + '_' + iid + '" src="' + blank + '" onclick="browse_uploads(\'image__' + c_id + '_' + d_id + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<textarea class="mousetrap" name="data[' + d_id + '][feld][' + c_id + '][' + iid + '][descr]" placeholder="' + place + '"></textarea>' + |
||||
'</div>' |
||||
); |
||||
browse_uploads('image__' + c_id + '_' + d_id + '_' + iid + ''); |
||||
Cascad3.cascad3_update(); |
||||
}); |
||||
}, |
||||
|
||||
cascad3_sortable: function() { |
||||
$('.cascad3_sortable').sortable({ |
||||
handle: ".header", |
||||
placeholder: "ui-state-highlight grey_bg" |
||||
}); |
||||
//$(".cascad3").disableSelection();
|
||||
}, |
||||
|
||||
cascad3_add_folder: function() { |
||||
$('.cascad3_add_folder').on('click', function(event) { |
||||
event.preventDefault(); |
||||
var c_id = $(this).parent().parent().parent('.cascad3').attr("data-id"); |
||||
var d_id = $(this).parent().parent().parent('.cascad3').attr("data-doc"); |
||||
browse_dirs("cascad3__" + c_id + '_' + d_id); |
||||
}); |
||||
} |
||||
} |
||||
|
||||
$(document).ready(function() { |
||||
Cascad3.init(); |
||||
|
||||
$.fn.myPlugin = function cascad3_add_items(dir, cid, did) { |
||||
|
||||
$.ajax({ |
||||
url: ave_path + 'admin/index.php?do=docs&action=image_import&ajax=run', |
||||
data: { |
||||
"path": dir |
||||
}, |
||||
dataType: "json", |
||||
success: function(data) { |
||||
$.alerts._overlay('hide'); |
||||
for (var p = 0, max = data.respons.length; p < max; p++) { |
||||
var iid = Cascad3.cascad3_maxid(cid, did); |
||||
var field_value = dir + data.respons[p]; |
||||
var img_path = '../index.php?thumb=' + field_value + '&mode=f&width=128&height=128'; |
||||
$('#cascad3_' + did + '_' + cid + ' > .cascad3_sortable:last').prepend( |
||||
'<div class="cascad3_item ui-state-default" id="cascad3_image_' + cid + '_' + did + '_' + iid + '" data-id="' + iid + '" doc=id="' + did + '">' + |
||||
'<div class="header grey_bg"></div>' + |
||||
'<a class="topDir icon_sprite ico_photo view fancy preview__' + cid + '_' + did + '_' + iid + '" href="' + field_value + '" title="' + look + '"></a>' + |
||||
'<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="' + del + '" data-id="' + cid + '_' + did + '_' + iid + '"></a>' + |
||||
'<span class="topDir icon_sprite ico_info info" title="' + field_value + '"></span>' + |
||||
'<input type="hidden" value="' + field_value + '" name="data[' + did + '][feld][' + cid + '][' + iid + '][url]" id="image__' + cid + '_' + did + '_' + iid + '">' + |
||||
'<img id="preview__' + cid + '_' + did + '_' + iid + '" src="' + img_path + '" onclick="browse_uploads(\'image__' + cid + '_' + did + '_' + iid + '\');" class="image" alt="" width="100" height="100" />' + |
||||
'<textarea class="mousetrap" name="data[' + did + '][feld][' + cid + '][' + iid + '][descr]" placeholder="' + place + '"></textarea>' + |
||||
'</div>' |
||||
); |
||||
Cascad3.cascad3_update(); |
||||
} |
||||
} |
||||
}); |
||||
} |
||||
|
||||
}); |
@ -1,27 +0,0 @@
|
||||
[admin] |
||||
name = "Изображение (Каскада, 3 полета)" |
||||
look = "Преглед" |
||||
link = "Промени пътя" |
||||
select = "Избери изображение" |
||||
delete = "Изтриване на елелемт от элемент каскадата" |
||||
place = "Описание" |
||||
del_conf = "Сигурни ли сте, че желаете да изтриете този елемент?<br>(Изображението няма да бъде изтрито от сървъра)" |
||||
del_head = "Изтриване на елемент от каскадата..." |
||||
add_n_e = "Добави нов елемент:" |
||||
add_f = "Избор на изображение" |
||||
add_d = "Избор на папка" |
||||
add_l = "Качи от компютъра" |
||||
add_upl_e = "Вие може за заредите изображения от локален компютър след създаването на документа. За това натиснете бутона по долу «Добави и продължи редактирането»" |
||||
upl_dir = "Папка: " |
||||
del_all = "Изтриване на всички елементи" |
||||
del_all_c = "Сигурни ли сте, че желаете да изтриете всички елементи?<br>(Изображенията няма да бъдат изтрити от сървъра)" |
||||
del_all_h = "Изтриване на всички елементи на каскадата..." |
||||
resp_s_h = "Изпълнено" |
||||
resp_s_m = "Файловете са успешно заредени" |
||||
resp_e_m = "Възникна грешка при зареждането на файловете. Моля, опитайте отново." |
||||
resp_e_h = "Грешка" |
||||
resp_m_m = "Броя на файловете за зареждане са повече от максималния, зададен в настройките на PHP." |
||||
resp_m_h = "Грешка" |
||||
max_f_f = "Максимален брой файлове за зареждане: " |
||||
max_f_h = "Грешка" |
||||
max_f_t = "Превишен е максималния брой файлове,<br>разрешен за едновременно зареждане" |
@ -1,29 +0,0 @@
|
||||
[admin] |
||||
name = "Zobrazení (Kaskáda, 3 inputy)" |
||||
look = "Zobrazit" |
||||
link = "Změnit cestu" |
||||
select = "Vybrat zobrazení" |
||||
delete = "Smazat prvek kaskády" |
||||
place = "Popis" |
||||
del_conf = "Opravdu chcete odstranit tento prvek?<br>(Zobrazení nebude smazáno ze serveru)" |
||||
del_head = "Smazání prvku kaskády..." |
||||
add_n_e = "Přidat nový element:" |
||||
add_f = "Vybrat zobrazení" |
||||
add_d = "Vybrat složku" |
||||
add_l = "Nahrát z počítače" |
||||
add_upl_e = "Můžete nahrávat obrázky z místního počítače po vytvoření dokumentu. Kliknutím níže na "Přidat a pokračovat v úpravách" |
||||
upl_dir = "Složka: " |
||||
del_all = "Odstranit všechny prvky" |
||||
del_all_c = "Opravdu chcete odstranit všechny prvky?<br>(Zobrazení nebude smazáno ze serveru)" |
||||
del_all_h = "Odstranit všechny prvky kaskádu..." |
||||
resp_s_h = "Hotovo" |
||||
resp_s_m = "Soubory úspěšně nahrány" |
||||
resp_s_h = "Hotovo" |
||||
resp_s_m = "Soubory úspěšně nahrány" |
||||
resp_e_m = "Při stahování souborů došlo k chybě. Zkuste znovu." |
||||
resp_e_h = "Chyba" |
||||
resp_m_m = "Počet souborů, které se mají nahrát překračují hodnotu zadanou v konfiguračním PHP." |
||||
resp_m_h = "Chyba" |
||||
max_f_f = "Maximální počet souborů ke stažení: " |
||||
max_f_h = "Chba" |
||||
max_f_t = Překročen maximální počet souborů,<br>během jednoho nahrávání" |
@ -1,26 +0,0 @@
|
||||
[en] |
||||
name = "Cascad NEW, 3 inputs" |
||||
look = "Lool" |
||||
link = "Change path" |
||||
select = "Select image" |
||||
delete = "Delete item cascade" |
||||
place = "Description" |
||||
del_conf = "are you sure You want to delete this item?<br>(the Image will not be deleted from the server)" |
||||
del_head = "Delete item cascade..." |
||||
add_n_e = "Add new item:" |
||||
add_f = "Select image" |
||||
add_d = "Select folder" |
||||
add_l = "Download to computer" |
||||
add_upl_e = "You can upload pictures from your computer after you create the document. To do this, press the bottom button "Add and continue editing"" |
||||
del_all = "Delete any items" |
||||
del_all_c = "are you sure You want to delete all items?<br>(Image will not be deleted from the server)" |
||||
del_all_h = "Delete all items of the cascade..." |
||||
resp_s_h = "Done" |
||||
resp_s_m = "File successfully loaded" |
||||
resp_e_m = "an error Occurred when uploading files. Try again." |
||||
resp_e_h = "Error" |
||||
resp_m_m = "number of uploaded file exceeds the value set in your PHP settings." |
||||
resp_m_h = "Error" |
||||
max_f_f = "Maximum number zagrozenia files:" |
||||
max_f_h = "Error" |
||||
max_f_t = "you have Exceeded the maximum number of files<br>to download" |
@ -1,27 +0,0 @@
|
||||
[admin] |
||||
name = "Obrazek (Kaskada, 3 input’y)" |
||||
look = "Popatrz" |
||||
link = "Zmień sposób" |
||||
select = "Wybierz obrazek" |
||||
delete = "Usuń kaskadę" |
||||
place = "Opis" |
||||
del_conf = "Czy na pewno chcesz usunąć ten element? <br> (Obrazek nie będzie usunięty z serwera)" |
||||
del_head = "Usuń element kaskady ..." |
||||
add_n_e = "Dodaj nowy element" |
||||
add_f = "Wybierz obrazek" |
||||
add_d = "Wybierz folder" |
||||
add_l = "Pobierz z komputera" |
||||
add_upl_e = "Możesz pobrać obrazki z komputera lokalnego po utworzeniu dokumentu. Aby to zrobić, kliknij poniżej na “Dodaj i kontynuować edycję”" |
||||
upl_dir = "Folder:" |
||||
del_all = "Usuń wszystkie elementy" |
||||
del_all_c = "Czy na pewno chcesz usunąć wszystkie elementy? <br /> (Obrazek nie będzie usunięty z serwera)" |
||||
del_all_h = "Usuń wszystkie pozycje kaskady..." |
||||
resp_s_h = "Gotowe" |
||||
resp_s_m = "Pliki pomyślnie pobrane" |
||||
resp_e_m = "Wystąpił błąd podczas pobierania plików. Spróbuj ponownie." |
||||
resp_e_h = "Błąd" |
||||
resp_m_m = "Liczba plików do przesłania przekracza wartości, określone w PHP konfiguracji." |
||||
resp_m_h = "Błąd" |
||||
max_f_f = "Maksymalna liczba plików do pobrania:" |
||||
max_f_h = "Błąd" |
||||
max_f_t = "Przekroczono maksymalną liczbę plików, <br /> na jednoczesne ładowanie" |
@ -1,27 +0,0 @@
|
||||
[admin] |
||||
name = "Изображение (Каскад, 3 инпута)" |
||||
look = "Посмотреть" |
||||
link = "Изменить путь" |
||||
select = "Выбрать изображение" |
||||
delete = "Удалить элемент каскада" |
||||
place = "параметр" |
||||
del_conf = "Вы уверены, что хотите удалить данный элемент?<br>(Изображение не будет удалено с сервера)" |
||||
del_head = "Удаление элемента каскада..." |
||||
add_n_e = "Добавить новый элемент:" |
||||
add_f = "Выбрать изображение" |
||||
add_d = "Выбрать папку" |
||||
add_l = "Загрузить с компьютера" |
||||
add_upl_e = "Вы сможете загрузить фотографии с локального компьютера после создания документа. Для этого нажмите внизу кнопку «Добавить и продолжить редактирование»" |
||||
upl_dir = "Папка: " |
||||
del_all = "Удалить все элементы" |
||||
del_all_c = "Вы уверены, что хотите удалить все элементы?<br>(Изображения не будет удалены с сервера)" |
||||
del_all_h = "Удаление всех элемента каскада..." |
||||
resp_s_h = "Выполнено" |
||||
resp_s_m = "Файлы успешно загрузились" |
||||
resp_e_m = "Возникла ошибка при загрузке файлов. Попробуйте еще раз." |
||||
resp_e_h = "Ошибка" |
||||
resp_m_m = "Кол-во загружаемых файлов превышает значение, заданное в настройках PHP." |
||||
resp_m_h = "Ошибка" |
||||
max_f_f = "Макимальное кол-во загружаемых файлов: " |
||||
max_f_h = "Ошибка" |
||||
max_f_t = "Превышено максимальное число файлов,<br>для одновременной загрузки" |
@ -1,27 +0,0 @@
|
||||
[admin] |
||||
name = "Зображення (Каскад, 3 інпута)" |
||||
look = "Подивитися" |
||||
link = "Змінити шлях" |
||||
select = "Обрати зображення" |
||||
delete = "Видалити елемент каскаду" |
||||
place = "Опис" |
||||
del_conf = "Ви впевнені, що бажаєте видалити цей елемент?<br>(Зображення не буде видалено зі сервера)" |
||||
del_head = "Видалення елемента каскаду..." |
||||
add_n_e = "Додати новий елемент:" |
||||
add_f = "Обрати зображення" |
||||
add_d = "Обрати папку" |
||||
add_l = "Завантажити з компьютера" |
||||
add_upl_e = "Ви зможете завантажити зображення з локального компьютера післе створення документа. Для цього натисніть внизу кнопку “Додати та продовжити редагування”" |
||||
upl_dir = "Папка: " |
||||
del_all = "Видалити всі елементи" |
||||
del_all_c = "Ви впевнені, що бажаєте видалити всі елементи?<br>(Зображення не буде видалено зі сервера)" |
||||
del_all_h = "Видалення всіх елементів каскаду..." |
||||
resp_s_h = "Виконано" |
||||
resp_s_m = "Файли успішно завантажилися" |
||||
resp_e_m = "Сталася помилка при завантаженні файлів. Спробуйте ще раз." |
||||
resp_e_h = "Помилка" |
||||
resp_m_m = "Кількість файлів для завантаження перевищує значення, яке вказане у налаштуваннях PHP." |
||||
resp_m_h = "Помилка" |
||||
max_f_f = "Максимальна кількість файлів для завантаження: " |
||||
max_f_h = "Помилка" |
||||
max_f_t = "Перевищено максимальне число файлів,<br>для одночасного завантаження" |
@ -1,3 +0,0 @@
|
||||
{foreach from=$field_value item=image} |
||||
<img src="{$image[0]}" alt="{if isset($image[1])}{$image[1]}{/if}" title="{if isset($image[1])}{$image[1]}{/if}"> |
||||
{/foreach} |
@ -1,3 +0,0 @@
|
||||
{foreach from=$field_value item=image} |
||||
<img src="{$image[0]}" alt="{if isset($image[1])}{$image[1]}{/if}" title="{if isset($image[1])}{$image[1]}{/if}"> |
||||
{/foreach} |
@ -1,65 +0,0 @@
|
||||
{if $cascad3_new_3inputs != load} |
||||
{assign var=cascad3_new_3inputs value='' scope="global"} |
||||
{if $smarty.request.outside} |
||||
<script src="{$ABS_PATH}fields/{$field_dir}/js/outside.js" type="text/javascript"></script> |
||||
{else} |
||||
<script src="{$ABS_PATH}fields/{$field_dir}/js/field.js" type="text/javascript"></script> |
||||
{/if} |
||||
<link href="{$ABS_PATH}fields/{$field_dir}/css/field.css" rel="stylesheet" type="text/css" media="screen" /> |
||||
<script type="text/javascript"> |
||||
var blank = '{$tpl_dir}/images/blanc.gif'; |
||||
var place = '{#place#}'; |
||||
var look = '{#look#}'; |
||||
var del = '{#delete#}'; |
||||
var del_conf = '{#del_conf#}'; |
||||
var del_head = '{#del_head#}'; |
||||
var del_all_c = '{#del_all_c#}'; |
||||
var del_all_h = '{#del_all_h#}'; |
||||
var max_f_t = '{#max_f_t#}'; |
||||
var max_f_h = '{#max_f_h#}'; |
||||
</script> |
||||
{assign var=cascad3_new_3inputs value="load" scope="global"} |
||||
{/if} |
||||
|
||||
<div class="cascad3" id="cascad3_{$doc_id}_{$field_id}" data-id="{$field_id}" data-doc="{$doc_id}" data-rubric="{$smarty.request.rubric_id}"> |
||||
<input type="hidden" value="" id="cascad3__{$field_id}_{$doc_id}"> |
||||
{if $show_upload} |
||||
<input type="file" class="cascad3_upload cascad3_upload_field_{$field_id}_{$doc_id}" multiple name="cascad3_files_{$field_id}_{$doc_id}[]" style="visibility: hidden; display: none;" data-max-files="{$max_files}" /> |
||||
{/if} |
||||
<ul class="messages"> |
||||
<li class="highlight grey"> |
||||
{#add_n_e#} |
||||
<a href="javascript:void(0);" class="cascad3_add_single link">{#add_f#}</a> |
||||
| |
||||
<a href="javascript:void(0);" class="cascad3_add_folder link">{#add_d#}</a> |
||||
| |
||||
<a href="javascript:void(0);" class="cascad3_del_all link">{#del_all#}</a> |
||||
{if $show_upload} |
||||
| |
||||
<a href="javascript:void(0);" class="cascad3_upload_local link">{#add_l#}</a> <a href="javascript:void(0);" class="topDir" title="{$max_files}<br>{$dir_upload}">[?]</a> |
||||
{else} |
||||
| |
||||
<a href="javascript:void(0);" class="topDir" title="{#add_upl_e#}<br><br>{$max_files}<br>{$dir_upload}">[?]</a> |
||||
{/if} |
||||
</li> |
||||
</ul> |
||||
|
||||
<div class="cascad3_sortable"> |
||||
{foreach from=$images key=key item=image} |
||||
|
||||
<div class="cascad3_item ui-state-default" id="cascad3_image_{$field_id}_{$doc_id}_{$key}" data-id="{$key}" data-doc="{$doc_id}"> |
||||
<div class="header grey_bg"></div> |
||||
<a class="topDir icon_sprite ico_photo view fancy preview__{$field_id}_{$doc_id}_{$key}" href="{$image.url}" title="{#look#}"></a> |
||||
<a class="topDir icon_sprite ico_delete delete" href="javascript:void(0);" title="{#delete#}" data-id="{$field_id}_{$doc_id}_{$key}"></a> |
||||
<span class="topDir icon_sprite ico_info info" title="{$image.url}"></span> |
||||
<input type="hidden" value="{$image.url}" name="feld[{$field_id}][{$key}][url]" id="image__{$field_id}_{$doc_id}_{$key}"> |
||||
<img id="preview__{$field_id}_{$doc_id}_{$key}" src="{$image.thumb}" onclick="browse_uploads('image__{$field_id}_{$doc_id}_{$key}');" class="image" alt="" width="100" height="100" /> |
||||
<input class="mousetrap" name="feld[{$field_id}][{$key}][descr]" placeholder="{#place#} 1" value="{$image.desc}"/> |
||||
<input class="mousetrap" name="feld[{$field_id}][{$key}][descr2]" placeholder="{#place#} 2" value="{$image.desc2}"/> |
||||
<input class="mousetrap" name="feld[{$field_id}][{$key}][descr3]" placeholder="{#place#} 3" value="{$image.desc3}"/> |
||||
</div> |
||||
|
||||
{/foreach} |
||||
</div> |
||||
|
||||
</div> |
@ -1,165 +1,167 @@
|
||||
<?php |
||||
/** |
||||
* Поле Цена |
||||
*/ |
||||
function get_field_teasers($field_value, $action, $field_id=0, $tpl='', $tpl_empty=0, &$maxlength = '', $doc_fields=array(), $rubric_id=0, $default='') |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
/** |
||||
* Teasers |
||||
*/ |
||||
function get_field_teasers($field_value, $action, $field_id=0, $tpl='', $tpl_empty=0, &$maxlength = '', $doc_fields=array(), $rubric_id=0, $default='') |
||||
{ |
||||
global $AVE_DB, $AVE_Template; |
||||
|
||||
$fld_dir = dirname(__FILE__) . '/'; |
||||
$tpl_dir = $fld_dir . 'tpl/'; |
||||
$fld_name = basename($fld_dir); |
||||
$fld_dir = dirname(__FILE__) . '/'; |
||||
$tpl_dir = $fld_dir . 'tpl/'; |
||||
$fld_name = basename($fld_dir); |
||||
|
||||
$lang_file = $fld_dir . 'lang/' . (defined('ACP') ? $_SESSION['admin_language'] : $_SESSION['user_language']) . '.txt'; |
||||
$lang_file = $fld_dir . 'lang/' . (defined('ACP') ? $_SESSION['admin_language'] : $_SESSION['user_language']) . '.txt'; |
||||
|
||||
$AVE_Template->config_load($lang_file, 'lang'); |
||||
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars()); |
||||
$AVE_Template->config_load($lang_file, 'admin'); |
||||
$AVE_Template->config_load($lang_file, 'lang'); |
||||
$AVE_Template->assign('config_vars', $AVE_Template->get_config_vars()); |
||||
$AVE_Template->config_load($lang_file, 'admin'); |
||||
|
||||
switch ($action) |
||||
{ |
||||
case 'edit': |
||||
switch ($action) |
||||
{ |
||||
case 'edit': |
||||
|
||||
$items = array(); |
||||
$items = array(); |
||||
|
||||
$items = unserialize($field_value); |
||||
$items = unserialize($field_value); |
||||
|
||||
if($items != false){ |
||||
if($items != false){ |
||||
|
||||
foreach($items as $k => $v){ |
||||
$list_item = explode('|', $v); |
||||
foreach($items as $k => $v){ |
||||
$list_item = explode('|', $v); |
||||
|
||||
$list[$k]['param'] = (isset($list_item[0])) ? htmlspecialchars($list_item[0], ENT_QUOTES) : ''; |
||||
$list[$k]['value'] = (isset($list_item[1])) ? htmlspecialchars($list_item[1], ENT_QUOTES) : ''; |
||||
} |
||||
$list[$k]['param'] = (isset($list_item[0])) ? htmlspecialchars($list_item[0], ENT_QUOTES) : ''; |
||||
$list[$k]['value'] = (isset($list_item[1])) ? htmlspecialchars($list_item[1], ENT_QUOTES) : ''; |
||||
} |
||||
|
||||
$items = $list; |
||||
} |
||||
$items = $list; |
||||
} |
||||
|
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'admin'); |
||||
$tpl_file = get_field_tpl($tpl_dir, $field_id, 'admin'); |
||||
|
||||
$AVE_Template->assign('doc_id', $_REQUEST['Id']); |
||||
$AVE_Template->assign('items', $items); |
||||
$AVE_Template->assign('field_dir', $fld_name); |
||||
$AVE_Template->assign('field_id', $field_id); |
||||
$AVE_Template->assign('doc_id', $_REQUEST['Id']); |
||||
$AVE_Template->assign('items', $items); |
||||
$AVE_Template->assign('field_dir', $fld_name); |
||||
$AVE_Template->assign('field_id', $field_id); |
||||
|
||||
return $AVE_Template->fetch($tpl_file); |
||||
return $AVE_Template->fetch($tpl_file); |
||||
|
||||
case 'save': |
||||
foreach ($field_value as $v) |
||||
{ |
||||
if(! empty($v['value']) && ! empty($v['param'])) |
||||
case 'save': |
||||
foreach ($field_value as $v) |
||||
{ |
||||
$field_value_new[] = $v['param'] . ($v['value'] ? '|' . $v['value'] : ''); |
||||
if(! empty($v['value']) && ! empty($v['param'])) |
||||
{ |
||||
$field_value_new[] = $v['param'] . ($v['value'] ? '|' . $v['value'] : ''); |
||||
} |
||||
} |
||||
} |
||||
if (isset($field_value_new)) |
||||
{ |
||||
return @serialize($field_value_new); |
||||
} |
||||
else |
||||
{ |
||||
return $field_value_new = ''; |
||||
} |
||||
break; |
||||
|
||||
case 'doc': |
||||
$items = (isset($field_value)) ? unserialize($field_value) : array(); |
||||
|
||||
$res = array(); |
||||
|
||||
if ($items != false) |
||||
{ |
||||
foreach($items as $item) |
||||
if (isset($field_value_new)) |
||||
{ |
||||
return @serialize($field_value_new); |
||||
} |
||||
else |
||||
{ |
||||
return $field_value_new = ''; |
||||
} |
||||
break; |
||||
|
||||
case 'doc': |
||||
$items = (isset($field_value)) |
||||
? unserialize($field_value) |
||||
: array(); |
||||
|
||||
$res = array(); |
||||
|
||||
if ($items != false) |
||||
{ |
||||
$item = explode('|', $item); |
||||
foreach($items as $item) |
||||
{ |
||||
$item = explode('|', $item); |
||||
|
||||
if ($item[1]) |
||||
$res[] = eval2var('?>' . showteaser($item[1]) . '<?'); |
||||
if ($item[1]) |
||||
$res[] = showteaser($item[1]); |
||||
} |
||||
} |
||||
} |
||||
|
||||
return (! empty($res)) |
||||
? implode(PHP_EOL, $res) |
||||
: $tpl; |
||||
|
||||
break; |
||||
|
||||
case 'req': |
||||
return get_field_default($field_value, $action, $field_id, $tpl, $tpl_empty); |
||||
|
||||
case 'name' : |
||||
return $AVE_Template->get_config_vars('name'); |
||||
break; |
||||
|
||||
case 'search': |
||||
|
||||
$field_default = explode(',', $default); |
||||
|
||||
$zap_1 = ($field_default[0]) ? ',' : ''; |
||||
$zap_2 = ($field_default[0] && $field_default[1]) ? ',' : ''; |
||||
|
||||
$sel_1 = ($field_default[0]) ? 'b.field_value as b1' : ''; |
||||
$sel_2 = ($field_default[1]) ? 'c.field_value as c1' : ''; |
||||
|
||||
$from_1 = ($field_default[0]) ? PREFIX . '_document_fields b' : ''; |
||||
$from_2 = ($field_default[1]) ? PREFIX . '_document_fields c' : ''; |
||||
|
||||
$search_1 = ($field_default[0]) ? "AND (b.document_id=a.Id AND b.rubric_field_id = " . $field_default[0] . ")" : ""; |
||||
$search_2 = ($field_default[1]) ? "AND (c.document_id=a.Id AND c.rubric_field_id = " . $field_default[1] . ")" : ""; |
||||
|
||||
$or_1 = ($field_default[0]) ? "OR (UPPER(b.field_value) LIKE UPPER('%" . $_REQUEST['q'] . "%'))" : ""; |
||||
$or_2 = ($field_default[1]) ? "OR (UPPER(c.field_value) LIKE UPPER('%" . $_REQUEST['q'] . "%'))" : ""; |
||||
|
||||
$sql = $AVE_DB->Query(" |
||||
SELECT |
||||
a.Id, |
||||
a.document_title |
||||
$zap_1 |
||||
$sel_1 |
||||
$zap_2 |
||||
$sel_2 |
||||
FROM |
||||
" . PREFIX . "_documents a |
||||
$zap_1 |
||||
" . $from_1 . " |
||||
$zap_2 |
||||
" . $from_2 . " |
||||
WHERE |
||||
a.rubric_id = '" . $_REQUEST['rubric_id'] . "' |
||||
AND |
||||
a.document_status = 1 |
||||
" . $search_1 . " |
||||
" . $search_2 . " |
||||
AND |
||||
( |
||||
(UPPER(document_title) LIKE UPPER('%" . $_REQUEST['q'] . "%')) |
||||
$or_1 |
||||
$or_2 |
||||
) |
||||
GROUP BY a.Id |
||||
LIMIT 0,5 |
||||
"); |
||||
|
||||
$doc_finded = array(); |
||||
|
||||
while ($row = $sql->FetchRow()) |
||||
{ |
||||
$doc_finded[] = array( |
||||
'doc_id' => $row->Id, |
||||
'doc_title' => $row->document_title, |
||||
'doc_name' => (($field_default[0]) ? $row->b1 : $row->document_title), |
||||
'doc_article' => (($field_default[1]) ? $row->c1 : '') |
||||
); |
||||
} |
||||
|
||||
echo json_encode($doc_finded); |
||||
exit; |
||||
|
||||
default: |
||||
return $field_value; |
||||
} |
||||
|
||||
return ($res ? $res : $field_value); |
||||
} |
||||
return (! empty($res)) |
||||
? implode(PHP_EOL, $res) |
||||
: $tpl; |
||||
|
||||
break; |
||||
|
||||
case 'req': |
||||
return get_field_default($field_value, $action, $field_id, $tpl, $tpl_empty); |
||||
|
||||
case 'name' : |
||||
return $AVE_Template->get_config_vars('name'); |
||||
break; |
||||
|
||||
case 'search': |
||||
|
||||
$field_default = explode(',', $default); |
||||
|
||||
$zap_1 = ($field_default[0]) ? ',' : ''; |
||||
$zap_2 = ($field_default[0] && $field_default[1]) ? ',' : ''; |
||||
|
||||
$sel_1 = ($field_default[0]) ? 'b.field_value as b1' : ''; |
||||
$sel_2 = ($field_default[1]) ? 'c.field_value as c1' : ''; |
||||
|
||||
$from_1 = ($field_default[0]) ? PREFIX . '_document_fields b' : ''; |
||||
$from_2 = ($field_default[1]) ? PREFIX . '_document_fields c' : ''; |
||||
|
||||
$search_1 = ($field_default[0]) ? "AND (b.document_id=a.Id AND b.rubric_field_id = " . $field_default[0] . ")" : ''; |
||||
$search_2 = ($field_default[1]) ? "AND (c.document_id=a.Id AND c.rubric_field_id = " . $field_default[1] . ")" : ''; |
||||
|
||||
$or_1 = ($field_default[0]) ? "OR (UPPER(b.field_value) LIKE UPPER('%" . $_REQUEST['q'] . "%'))" : ''; |
||||
$or_2 = ($field_default[1]) ? "OR (UPPER(c.field_value) LIKE UPPER('%" . $_REQUEST['q'] . "%'))" : ''; |
||||
|
||||
$sql = $AVE_DB->Query(" |
||||
SELECT |
||||
a.Id, |
||||
a.document_title |
||||
$zap_1 |
||||
$sel_1 |
||||
$zap_2 |
||||
$sel_2 |
||||
FROM |
||||
" . PREFIX . "_documents a |
||||
$zap_1 |
||||
" . $from_1 . " |
||||
$zap_2 |
||||
" . $from_2 . " |
||||
WHERE |
||||
a.rubric_id = '" . $_REQUEST['rubric_id'] . "' |
||||
AND |
||||
a.document_status = 1 |
||||
" . $search_1 . " |
||||
" . $search_2 . " |
||||
AND |
||||
( |
||||
(UPPER(document_title) LIKE UPPER('%" . $_REQUEST['q'] . "%')) |
||||
$or_1 |
||||
$or_2 |
||||
) |
||||
GROUP BY a.Id |
||||
LIMIT 0,5 |
||||
"); |
||||
|
||||
$doc_finded = array(); |
||||
|
||||
while ($row = $sql->FetchRow()) |
||||
{ |
||||
$doc_finded[] = array( |
||||
'doc_id' => $row->Id, |
||||
'doc_title' => $row->document_title, |
||||
'doc_name' => (($field_default[0]) ? $row->b1 : $row->document_title), |
||||
'doc_article' => (($field_default[1]) ? $row->c1 : '') |
||||
); |
||||
} |
||||
|
||||
echo json_encode($doc_finded); |
||||
exit; |
||||
|
||||
default: |
||||
return $field_value; |
||||
} |
||||
|
||||
return ($res ? $res : $field_value); |
||||
} |
||||
?> |
@ -1,3 +1,9 @@
|
||||
[admin] |
||||
|
||||
name = "YouTube" |
||||
f_url = "Линк" |
||||
f_width = "Ширина" |
||||
f_height = "Височина" |
||||
f_fullscreen = "На цял екран" |
||||
f_allow = "Разреши" |
||||
f_forbidden = "Забрани" |
||||
f_metod = "Метод на вмъкване" |
||||
|
@ -1,2 +1,9 @@
|
||||
[admin] |
||||
name = "YouTube" |
||||
f_url = "Ссылка" |
||||
f_width = "Ширина" |
||||
f_height = "Высота" |
||||
f_fullscreen = "Полноэкранный режим" |
||||
f_allow = "Разрешить" |
||||
f_forbidden = "Запретить" |
||||
f_metod = "Метод вставки" |
@ -1,2 +1,9 @@
|
||||
[admin] |
||||
name = "YouTube" |
||||
f_url = "Url" |
||||
f_width = "Width" |
||||
f_height = "Height" |
||||
f_fullscreen = "Fullscreen" |
||||
f_allow = "Allow" |
||||
f_forbidden = "Forbidden" |
||||
f_metod = "Metod" |
@ -1,2 +1,9 @@
|
||||
[admin] |
||||
name = "YouTube" |
||||
f_url = "Url" |
||||
f_width = "Width" |
||||
f_height = "Height" |
||||
f_fullscreen = "Fullscreen" |
||||
f_allow = "Allow" |
||||
f_forbidden = "Forbidden" |
||||
f_metod = "Metod" |
@ -1,2 +1,9 @@
|
||||
[admin] |
||||
name = "YouTube" |
||||
f_url = "Ссылка" |
||||
f_width = "Ширина" |
||||
f_height = "Высота" |
||||
f_fullscreen = "Полноэкранный режим" |
||||
f_allow = "Разрешить" |
||||
f_forbidden = "Запретить" |
||||
f_metod = "Метод вставки" |
@ -1,2 +1,9 @@
|
||||
[admin] |
||||
name = "YouTube" |
||||
f_url = "Url" |
||||
f_width = "Width" |
||||
f_height = "Height" |
||||
f_fullscreen = "Fullscreen" |
||||
f_allow = "Allow" |
||||
f_forbidden = "Forbidden" |
||||
f_metod = "Metod" |
@ -1,24 +1,24 @@
|
||||
<div class="mb10"> |
||||
Ссылка: |
||||
{#f_url#}: |
||||
<input type="text" style="width: 100%;" name="feld[{$field_id}][url]" value="{$video.0}" class="mousetrap" /> |
||||
</div> |
||||
|
||||
<div class="mb10"> |
||||
Ширина: <input type="text" style="width: 50px;" name="feld[{$field_id}][width]" value="{$video.1}" class="mousetrap" /> px |
||||
{#f_width#}: <input type="text" style="width: 50px;" name="feld[{$field_id}][width]" value="{$video.1}" class="mousetrap" /> px |
||||
|
||||
Высота: <input type="text" style="width: 50px;" name="feld[{$field_id}][height]" value="{$video.2}" class="mousetrap" /> px |
||||
{#f_height#}: <input type="text" style="width: 50px;" name="feld[{$field_id}][height]" value="{$video.2}" class="mousetrap" /> px |
||||
</div> |
||||
|
||||
<div class="mb10"> |
||||
Полноэкранный режим: |
||||
{#f_fullscreen#}: |
||||
<select name="feld[{$field_id}][fullscreen]"> |
||||
<option value="true" {if $video.3 == 'true'}selected{/if}>Разрешить</option> |
||||
<option value="false" {if $video.3 == 'false'}selected{/if}>Запретить</option> |
||||
<option value="true" {if $video.3 == 'true'}selected{/if}>{#f_allow#}</option> |
||||
<option value="false" {if $video.3 == 'false'}selected{/if}>{#f_forbidden#}</option> |
||||
</select> |
||||
|
||||
Метод вставки: |
||||
{#f_metod#}: |
||||
<select name="feld[{$field_id}][source]"> |
||||
<option value="embed" {if $video.4 == 'embed'}selected{/if}>Embed</option> |
||||
<option value="iframe" {if $video.4 == 'iframe'}selected{/if}>Iframe</option> |
||||
</select> |
||||
</div> |
||||
</div> |
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue