1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
hot_keys_act.php
См. документацию.
1<?
2define("NO_KEEP_STATISTIC", true);
3define("NO_AGENT_STATISTIC", true);
4define("NOT_CHECK_PERMISSIONS", true);
5require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_admin_before.php");
6
8$uid=$USER->GetID();
9
10if($USER->IsAuthorized() && check_bitrix_sessid())
11{
12 $res = false;
13
14 switch ($_REQUEST["hkaction"])
15 {
16 case 'add':
17
19 "KEYS_STRING"=>rawurldecode($_REQUEST["KEYS_STRING"]),
20 "CODE_ID"=>$_REQUEST["CODE_ID"],
21 "USER_ID"=>$uid
22 );
23
25 break;
26
27 case 'update':
28
29 if($hkInstance->GetUIDbyHID($_REQUEST["ID"])==$uid)
30 $res = $hkInstance->Update($_REQUEST["ID"],array( "KEYS_STRING"=>rawurldecode($_REQUEST["KEYS_STRING"]) ));
31
32 break;
33
34 case 'delete':
35
36 if($hkInstance->GetUIDbyHID($_REQUEST["ID"])==$uid)
37 $res = $hkInstance->Delete($_REQUEST["ID"]);
38
39 break;
40
41 case 'delete_all':
42
43 $res=0;
44 $listRes=$hkInstance->GetList(array(),array( "USER_ID" => $uid ));
45 while($arHK=$listRes->Fetch())
46 $res += $hkInstance->Delete($arHK["ID"]);
47
48 break;
49
50 case 'set_default':
51
52 $sdRes = $hkInstance->SetDefault($uid);
53 if($sdRes)
54 {
55 $res="";
56 $listRes=$hkInstance->GetList(array(),array( "USER_ID" => $uid ));
57 while($arHK=$listRes->Fetch())
58 $res.=$arHK["CODE_ID"]."::".$arHK["ID"]."::".$arHK["KEYS_STRING"].";;";
59 }
60
61 break;
62
63 case 'export':
64
65 $tmpExportFile = $hkInstance->Export();
66
67 if($tmpExportFile)
68 if(file_exists($tmpExportFile))
69 if(filesize($tmpExportFile)>0)
70 {
71 header('Content-type: application/force-download');
72 header('Content-Disposition: attachment; filename="'.CHotKeys::$ExpImpFileName.'"');
73 $res = file_get_contents($tmpExportFile);
74 break;
75 }
76
77 $res='
78 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
79 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.LANGUAGE_ID.'" lang="'.LANGUAGE_ID.'">
80 <body>
81 <script>alert("'.GetMessage("HK_EXP_FALSE").'");
82 window.close();
83 </script>
84 </body></html>';
85 break;
86
87 case 'import':
88
89 if(!$_FILES['bx_hk_filename']['name'] || !$_FILES['bx_hk_filename']['size'])
90 {
91 $res='<script>window.parent.BXHotKeys.OnImportResponse(0);</script>';
92 break;
93 }
94
95 $numImported = 0;
96
97 $tmpDir = CTempFile::GetDirectoryName();
98 CheckDirPath($tmpDir);
99
100 $name = $tmpDir.basename($_FILES['bx_hk_filename']['name']);
101
102 if(move_uploaded_file($_FILES['bx_hk_filename']['tmp_name'], $tmpDir.CHotKeys::$ExpImpFileName))
103 $numImported = $hkInstance->Import($tmpDir.CHotKeys::$ExpImpFileName,$uid);
104
105 $res='<script>window.parent.BXHotKeys.OnImportResponse("'.$numImported.'");</script>';
106
107 break;
108 }
109
110 echo $res;
111}
112
113require($_SERVER["DOCUMENT_ROOT"].BX_ROOT."/modules/main/include/epilog_admin_after.php");
114?>
const BX_ROOT
Определения bx_root.php:3
static GetInstance()
Определения hot_keys.php:435
static $ExpImpFileName
Определения hot_keys.php:430
$arFields
Определения dblapprove.php:5
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$res
Определения filter_act.php:7
$_REQUEST["admin_mnu_menu_id"]
Определения get_menu.php:8
$uid
Определения hot_keys_act.php:8
$hkInstance
Определения hot_keys_act.php:7
$_SERVER["DOCUMENT_ROOT"]
Определения cron_frame.php:9
global $USER
Определения csv_new_run.php:40
check_bitrix_sessid($varname='sessid')
Определения tools.php:4686
CheckDirPath($path)
Определения tools.php:2707
GetMessage($name, $aReplace=null)
Определения tools.php:3397
$name
Определения menu_edit.php:35