1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
push.php
См. документацию.
1<?
3
5{
6 private static $arData = array();
7
8 public static function addData($branchName, $arData)
9 {
10 $result = true;
11
12 if($branchName <> '')
13 self::$arData[$branchName] = $arData;
14 else
15 $result = false;
16
17 return $result;
18 }
19
20 public static function getData($path = "")
21 {
22 $arResult = self::$arData;
23
25 "TYPE" => "SECTIONS_SECTION",
26 "TITLE" => GetMessage("MOBILEAPP_PUSH_SECTIONS"),
27 "SECTIONS" => $arResult
28 );
29
30 $arPath = explode("/", $path);
31
32 if(is_array($arPath))
33 {
34 foreach ($arPath as $idx)
35 {
36 if(isset($arResult["SECTIONS"][$idx]))
37 $arResult = $arResult["SECTIONS"][$idx];
38 else
39 break;
40 }
41 }
42
43 return $arResult;
44 }
45
46 public static function getOptions($path = "")
47 {
48 global $USER;
49 $arOptions = array();
50
51 foreach (GetModuleEvents("mobileapp", "OnBeforeAdminMobilePushOptsLoad", true) as $arHandler)
52 ExecuteModuleEventEx($arHandler, array(
53 $USER->GetID(),
54 $path,
56 ));
57
58 if(empty($arOptions))
59 {
60 $arResult = CUserOptions::GetOption('mobileapp', 'push_options', array());
61 $arPath = explode("/", $path);
62
63 if(is_array($arPath))
64 {
65 foreach ($arPath as $idx)
66 {
67 if(isset($arResult[$idx]))
68 $arResult = $arResult[$idx];
69 else
70 break;
71 }
72 }
73 }
74 else
75 {
77 }
78
79 return $arResult;
80 }
81
82 public static function saveOptions($path = "", $arOpts)
83 {
84 $result = true;
85 $opts = self::getOptions();
86 $arTmp = &$opts;
87 $arPath = explode("/", $path);
88
89 if(is_array($arPath))
90 {
91 foreach ($arPath as $pathItem)
92 {
93 if(!isset($arTmp[$pathItem]) || !is_array($arTmp[$pathItem]))
94 $arTmp[$pathItem] = array();
95
96 $arTmp = &$arTmp[$pathItem];
97 }
98
99 $arTmp = $arOpts;
100 }
101
102 return CUserOptions::SetOption('mobileapp', 'push_options', $opts);
103 }
104
105 public static function OnAdminMobileGetPushSettings()
106 {
107 foreach (GetModuleEvents("mobileapp", "OnAdminMobileGetPushSettings", true) as $arHandler)
108 ExecuteModuleEventEx($arHandler);
109
110 if(!empty(self::$arData))
111 {
112 $arItems = array();
113
114 foreach (self::$arData as $optBranch => $arOptions)
115 {
116 $arItems[] = array(
117 "text" => $arOptions["TITLE"],
118 "data-url" => "/bitrix/admin/mobile/push.php?path=".urlencode($optBranch),
119 "data-pageid" => "push_settings_".$optBranch
120 );
121 }
122
123 if(!empty($arItems))
124 {
125 $arMenuData = array(
126 "type" => "section",
127 "sort" => "990",
128 "text" => GetMessage("MOBILEAPP_PUSH_TITLE"),
129 "items" => $arItems
130 );
131
132 CAdminMobileMenu::addItem($arMenuData);
133 }
134 }
135 }
136}
137?>
$path
Определения access_edit.php:21
$arResult
Определения generate_coupon.php:16
static addItem($arItem)
Определения interface.php:7
Определения push.php:5
static getData($path="")
Определения push.php:20
static getOptions($path="")
Определения push.php:46
static saveOptions($path="", $arOpts)
Определения push.php:82
static addData($branchName, $arData)
Определения push.php:8
static OnAdminMobileGetPushSettings()
Определения push.php:105
$arPath
Определения file_edit.php:72
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
global $USER
Определения csv_new_run.php:40
$arOptions
Определения structure.php:223
ExecuteModuleEventEx($arEvent, $arParams=[])
Определения tools.php:5214
GetModuleEvents($MODULE_ID, $MESSAGE_ID, $bReturnArray=false)
Определения tools.php:5177
IncludeModuleLangFile($filepath, $lang=false, $bReturnArray=false)
Определения tools.php:3778
GetMessage($name, $aReplace=null)
Определения tools.php:3397
if(intval($iTestTransaction) > 0) $arTmp
Определения payment.php:22