Selects.php
См. документацию.
1 <?php
2 
3 /**
4  * @file
5  * @brief контроллер управления моделями выборок и форматирование вывода в таблицах
6  *
7  */
8 
9 namespace Wrong\Models;
10 
13 use Wrong\File\Path;
16 use Wrong\Start\Env;
17 use Cron\CronExpression;
19 
20 /**
21  * @brief Selects контроллер управления моделями выборок, расширяет Controller
22  *
23  */
24 
25 class Selects extends Controller implements ModelsInterface
26 {
27 
28  /**
29  * создает в бд запись для новой модели типа "выборка" и копирует указанный файл шаблона
30  *
31  * @param array $arr массив данных модели
32  * @param array $replace_path массив путей для замены в файле и параметры запроса.
33  *
34  * @return int Последний вставленный идентификатор.
35  */
36  public static function create($arr, $replace_path = [])
37  {
38  $dbh = Connect::getInstance()->dbh;
39  if ($replace_path) {
40  $arr['file'] = strtr($arr['file'], $replace_path);
41  $arr['request'] = strtr($arr['request'], $replace_path);
42  }
43  Path::mkdir($_SERVER['DOCUMENT_ROOT'] . $arr['file']);
44  $arr['template_filename'] = Templates::all_available($arr['template_id'])[0]->file;
45  if (copy($_SERVER['DOCUMENT_ROOT'] . $arr['template_filename'], $_SERVER['DOCUMENT_ROOT'] . $arr['file'])) {
46  $sth = $dbh->prepare("INSERT INTO `selects` (`request`, `file`, `groups`, `owner_group`) VALUES (:request, :file, :groups, :owner_group)");
47  $arr['groups'] = json_encode($arr['groups']);
48  $sth->bindValue(':request', $arr['request']);
49  $sth->bindValue(':file', $arr['file']);
50  $sth->bindValue(':groups', $arr['groups']);
51  $sth->bindValue(':owner_group', $arr['owner_group']);
52  $sth->execute();
53  return $dbh->lastInsertId();
54  } else {
55  Path::rmdir($_SERVER['DOCUMENT_ROOT'] . $arr['file']);
56  }
57  }
58 
59  /**
60  * форматирует данные для таблиц выборок.
61  *
62  * @param array $arr Массив данных таблицы для форматирования.
63  * @param array $columns массив имен столбцов
64  * @param string $table Имя таблицы для редактирования.
65  *
66  * @return array $arr отформатированный массив данных
67  */
68  public static function formatter($arr, $columns, $table)
69  {
70  global $user;
71 
73 
74  if (($key_column = array_search('owner_group', $columns)) && Env::$e->SUBORDINATE_MODELS) {
75  foreach ($arr as $key => $row) {
76  $owner_group = $row[$key_column];
77  if (!in_array($owner_group, $user->subordinate_groups)) {
78  unset($arr[$key]);
79  }
80  }
81  }
82 
83  if (Env::$e->HIDE_NON_ACTIVE_GROUP_MODELS) {
84  foreach ($arr as $key => $row) {
85  $owner_group = $row[$key_column];
87  unset($arr[$key]);
88  }
89  }
90  }
91 
92  if (in_array($table, ['actions', 'modals', 'selects', 'templates', 'pages'])) {
93  $key_file = array_search('file', $columns);
94  foreach ($arr as $key => $row) {
95  $arr[$key][] = '<a title="<div class=\'text-left small\'>Файл: ' . $arr[$key][$key_file] . '<br>Последнее изменение: ' . date('Y-m-d H:i:s', filemtime($_SERVER['DOCUMENT_ROOT'] . $arr[$key][$key_file])) . '<div>" data-id="' . $row[0] . '" data-table="' . $table . '" data-target="#edit-code" data-toggle="modal" class="d-block text-center editable-act px-1" href="#"><i class="fa fa-file-code-o"></i></a>';
96  }
97  }
98 
99  if (in_array($table, ['actions', 'modals', 'selects', 'templates', 'pages', 'crontabs'])) {
100  if ($table == 'crontabs') {
101  foreach ($arr as $key => $row) {
102  $arr[$key][] = '<a title="Выполнить задачу сейчас" data-id="' . $row[0] . '" data-table="' . $table . '" data-copy="true" data-precallback="precallbackShedule" data-callback="callbackAction" data-action="' . Actions::name(46) . '" data-confirm="true" data-header="Выполнить сейчас <b>ID ' . $row[0] . '</b>?" data-body="Выполнить задачу <b>ID ' . $row[0] . '</b> сейчас? Задача будет выполнена в одном потоке, вне зависимости от настроек потоков." class="d-block text-center editable-act px-1" href="#"><i class="fa fa-play"></i></a>';
103  }
104  }
105  foreach ($arr as $key => $row) {
106  $arr[$key][] = '<a title="Копировать модель" data-id="' . $row[0] . '" data-table="' . $table . '" data-copy="true" data-callback="callbackAction" data-action="' . Actions::name(37) . '" data-confirm="true" data-header="Копировать <b>ID ' . $row[0] . '</b>?" data-body="Копировать модель <b>ID ' . $row[0] . '</b> и добавить копию?" class="d-block text-center editable-act px-1" href="#"><i class="fa fa-copy"></i></a>';
107  $arr[$key][] = '<a title="Экспорт модели" data-id="' . $row[0] . '" data-table="' . $table . '" data-action="' . Actions::name(37) . '" data-confirm="false" data-header="Экспорт <b>ID ' . $row[0] . '</b>?" data-body="Экспортировать модель <b>ID ' . $row[0] . '</b>?" data-response="script" class="d-block text-center editable-act px-1" href="#"><i class="fa fa-download"></i></a>';
108  }
109  }
110 
111  if ($table == 'groups') {
112  foreach ($arr as $key => $row) {
113  if ($key_column && $arr[$key][$key_column] == 1) {
114  $arr[$key][] = '<a title="Очистить от моделей" onclick="errorToast(\'Системный функционал удалять нельзя!\');setTimeout(()=>{$(\'.editable\').removeClass(\'editable\');},100);return false;" class="text-danger d-block text-center editable-act px-1" href="#"><i class="fa fa-eraser"></i></a>';
115  } else {
116  $arr[$key][] = '<a title="Очистить от моделей" data-id="' . $row[0] . '" data-table="' . $table . '" data-action="' . Actions::name(36) . '" data-confirm="true" data-header="Очистить <b>ID ' . $row[0] . '</b>?" data-body="Очистить <b>ID ' . $row[0] . '</b> от всех принадлежащих группе моделей? ' . ($table == 'groups' ? '<b>Внимание!</b> Все модели, файлы, группы, пользователи и функционал принадлежащий данной группе будут удалены!' : '') . '" data-callback="afterRemoved" class="text-danger d-block text-center editable-act px-1" href="#"><i class="fa fa-eraser"></i></a>';
117  }
118  }
119  }
120 
121  foreach ($arr as $key => $row) {
122  if ($key_column && $arr[$key][$key_column] == 1) {
123  $arr[$key][] = '<a title="Удалить" onclick="errorToast(\'Системный функционал удалять нельзя!\');setTimeout(()=>{$(\'.editable\').removeClass(\'editable\');},100);return false;" class="text-danger d-block text-center editable-act px-1" href="#"><i class="fa fa-trash"></i></a>';
124  } else {
125  $arr[$key][] = '<a title="Удалить" data-id="' . $row[0] . '" data-table="' . $table . '" data-action="' . Actions::name(9) . '" data-confirm="true" data-header="Удалить <b>ID ' . $row[0] . '</b>?" data-body="Удалить <b>ID ' . $row[0] . '</b> навсегда из системы? ' . ($table == 'groups' ? '<b>Внимание!</b> Все модели, файлы, группы, пользователи и функционал принадлежащий данной группе будут тоже удалены!' : '') . '" data-callback="afterRemoved" class="text-danger d-block text-center editable-act px-1" href="#"><i class="fa fa-trash"></i></a>';
126  }
127  }
128 
129  if ($table == 'users') {
130  $owner_column = array_search('owner_group', $columns);
131  $key_column = array_search('x_auth_token', $columns);
132  foreach ($arr as $key => $item) {
133  $owner_group = $item[$owner_column];
134  if (in_array($owner_group, $user->subordinate_groups) || $owner_group == $user->main_group_id || $item[$key_column] == $user->x_auth_token) {
135  $arr[$key][$key_column] = '<div class="copy-text">' . $item[$key_column] . '</div>';
136  } else {
137  $arr[$key][$key_column] = '***';
138  }
139  }
140 
141  $key_column = array_search('email', $columns);
142  foreach ($arr as $key => $item) {
143  $owner_group = $item[$owner_column];
144  if (in_array($owner_group, $user->subordinate_groups) || $owner_group == $user->main_group_id || $item[$key_column] == $user->email) {
145  $arr[$key][$key_column] = '<div class="copy-text">' . $item[$key_column] . '</div>';
146  } else {
147  $arr[$key][$key_column] = '***';
148  }
149  }
150 
151  $key_column = array_search('ip', $columns);
152  foreach ($arr as $key => $item) {
153  $owner_group = $item[$owner_column];
154  if (!in_array($owner_group, $user->subordinate_groups) && $owner_group != $user->main_group_id && $item[$key_column] != $user->ip) {
155  $arr[$key][$key_column] = '***';
156  }
157  }
158  }
159 
160  if (($key_column = array_search('act', $columns)) && ($key_owner = array_search('owner_group', $columns))) {
161  foreach ($arr as $key => $item) {
162  $data_system = $item[$key_owner] == 1 ? 'onclick="$(this).data(\'confirm\', $(this).prev().is(\':checked\'));" data-confirm="false" data-header="Предупреждение" data-body="Владелец Система. Отключение системного функционала может привести к нежелательным последствиям! Отключить всё равно?"' : '';
163  $arr[$key][$key_column] = '<input class="tgl tgl-flip" id="tgl-' . $item[0] . '" type="checkbox" ' . ($item[$key_column] ? 'checked' : '') . '>
164  <label title="' . ($item[$key_column] ? 'Выключить' : 'Включить') . '" data-owner="' . intval(in_array($item[$key_owner], $user->groups)) . '" data-action="' . Actions::name(6) . '" ' . $data_system . ' data-table="' . $table . '" data-id="' . $item[0] . '" data-callback="toggled" class="tgl-btn mx-auto" data-tg-off="Выкл" data-tg-on="Вкл" for="tgl-' . $item[0] . '"></label>';
165  }
166  }
167 
168  if ($key_column = array_search('groups', $columns)) {
169  foreach ($arr as $key => $item) {
170  $arr[$key][$key_column] = Group::groupNamesText($item[$key_column]);
171  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act edit-wrapper-text" data-id="' . $item[0] . '" data-target="#edit-groups" data-toggle="modal" data-table="' . $table . '" title="' . $arr[$key][$key_column] . '">' . $arr[$key][$key_column] . '<i class="fa fa-edit"></i></div>';
172  }
173  }
174 
175  if ($key_column = array_search('owner_group', $columns)) {
176  foreach ($arr as $key => $item) {
177  $arr[$key][$key_column] = Group::text($item[$key_column]);
178  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-owner" data-toggle="modal" data-table="' . $table . '">' . $arr[$key][$key_column] . '<i class="fa fa-edit"></i></div>';
179  }
180  }
181 
182  if ($key_column = array_search('file', $columns)) {
183  foreach ($arr as $key => $item) {
184  $arr[$key][$key_column] = '<div title="' . $item[$key_column] . '" class="edit-wrapper editable-act px-1" data-id="' . $item[0] . '" data-target="#edit-file" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
185  }
186  }
187 
188  if (($key_column = array_search('request', $columns)) && $table != 'users') {
189  foreach ($arr as $key => $item) {
190  $arr[$key][$key_column] = '<div title="' . $item[$key_column] . '" class="edit-wrapper edit-wrapper-text editable-act" data-id="' . $item[0] . '" data-target="#edit-request" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
191  }
192  }
193 
194 
195  if ($key_column = array_search('name', $columns)) {
196  foreach ($arr as $key => $item) {
197  $arr[$key][$key_column] = '<div class="edit-wrapper edit-wrapper-text editable-act" data-id="' . $item[0] . '" data-target="#edit-name" data-toggle="modal" data-table="' . $table . '" title="' . $arr[$key][$key_column] . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
198  }
199  }
200 
201  if ($key_column = array_search('note', $columns)) {
202  foreach ($arr as $key => $item) {
203  $arr[$key][$key_column] = '<div title="' . nl2br($item[$key_column]) . '" class="edit-wrapper edit-wrapper-text editable-act" data-id="' . $item[0] . '" data-target="#edit-note" data-toggle="modal" data-table="' . $table . '">' . nl2br($item[$key_column]) . '<i class="fa fa-edit"></i></div>';
204  }
205  }
206 
207  if ($key_column = array_search('cache_time', $columns)) {
208  foreach ($arr as $key => $item) {
209  $arr[$key][$key_column] = '<div title="Время кеширования: ' . $item[$key_column] . ' сек." class="edit-wrapper edit-wrapper-text editable-act text-nowrap" data-id="' . $item[0] . '" data-target="#edit-cache-time" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . ' сек.<i class="fa fa-edit"></i></div>';
210  }
211  }
212 
213  if ($table == 'groups') {
214  if ($key_column = array_search('weight', $columns)) {
215  foreach ($arr as $key => $item) {
216  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-weight" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
217  }
218  }
219 
220  if ($key_column = array_search('models_limit', $columns)) {
221  foreach ($arr as $key => $item) {
222  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-models-limit" data-toggle="modal" data-table="' . $table . '">' . ($item[$key_column] ? $item[$key_column] : 'Без лимита') . '<i class="fa fa-edit"></i></div>';
223  }
224  }
225 
226  if ($key_column = array_search('\'count_active_models\'', $columns)) {
227  foreach ($arr as $key => $item) {
228  $arr[$key][$key_column] = '<div class="text-center" style="margin-left:-25px;">' . Group::count_all_owner_models($item[0]) . ' / ' . Group::count_all_owner_models($item[0], true) . '</div>';
229  }
230  }
231 
232  if ($key_column = array_search('\'count_available_models\'', $columns)) {
233  foreach ($arr as $key => $item) {
234  $arr[$key][$key_column] = Group::count_all_available_models($item[0]);
235  }
236  }
237  }
238 
239  if ($table == 'pages') {
240  if ($key_column = array_search('template_id', $columns)) {
241  foreach ($arr as $key => $item) {
242  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-template" data-toggle="modal" data-table="' . $table . '">' . Templates::find($item[$key_column])->name . '<i class="fa fa-edit"></i></div>';
243  }
244  }
245 
246  $key_column = array_search('id', $columns);
247  foreach ($arr as $key => $item) {
248  $arr[$key][$key_column] = '<a title="Посмотреть страницу" class="link-wrapper" data-toggle="modal" data-target="#view-page" data-uri="' . Pages::find($item[$key_column])->request . '" href="#">' . $item[$key_column] . '<i class="fa fa-external-link"></i></a>';
249  }
250  }
251 
252  if ($table == 'actions') {
253  $key_column = array_search('id', $columns);
254  foreach ($arr as $key => $item) {
255  $arr[$key][$key_column] = '<a title="Конструктор триггера" class="link-wrapper" data-toggle="modal" data-name="' . Actions::name($item[$key_column]) . '" data-target="#construct-action" href="#">' . $item[$key_column] . '<i class="fa fa-cubes"></i></a>';
256  }
257  }
258 
259  if ($table == 'modals') {
260  $key_column = array_search('id', $columns);
261  foreach ($arr as $key => $item) {
262  $arr[$key][$key_column] = '<a title="Конструктор триггера" class="link-wrapper" data-toggle="modal" data-name="' . Modals::name($item[$key_column]) . '" data-target="#construct-modal" href="#">' . $item[$key_column] . '<i class="fa fa-cubes"></i></a>';
263  }
264  }
265 
266  if (($key_column = array_search('logs', $columns))) {
267  foreach ($arr as $key => $item) {
268  $arr[$key][$key_column] = '<input class="tgl tgl-flip" id="tgl-log-' . $item[0] . '" type="checkbox" ' . ($item[$key_column] ? 'checked' : '') . '>
269  <label title="' . ($item[$key_column] ? 'Выключить' : 'Включить') . '" data-action="' . Actions::name(22) . '" data-id="' . $item[0] . '" data-callback="toggledLogs" class="tgl-btn mx-auto" data-tg-off="Выкл" data-tg-on="Вкл" for="tgl-log-' . $item[0] . '"></label>';
270  }
271  }
272 
273  if ($table == 'users') {
274  $key_column = array_search('api_act', $columns);
275  foreach ($arr as $key => $item) {
276  $arr[$key][$key_column] = '<input class="tgl tgl-flip" id="tgl-api-' . $item[0] . '" type="checkbox" ' . ($item[$key_column] ? 'checked' : '') . '>
277  <label title="' . ($item[$key_column] ? 'Выключить' : 'Включить') . '" data-action="' . Actions::name(28) . '" data-id="' . $item[0] . '" data-callback="toggledApi" class="tgl-btn mx-auto" data-tg-off="Выкл" data-tg-on="Вкл" for="tgl-log-' . $item[0] . '"></label>';
278  }
279 
280  $key_column = array_search('id', $columns);
281  foreach ($arr as $key => $item) {
282  $arr[$key][$key_column] = '<a title="Вход от имени: ' . Users::find($item[0])->email . '" data-action="' . Actions::name(23) . '" data-id="' . $item[0] . '" data-callback="fromUser" class="link-wrapper" href="#">' . $item[$key_column] . '<i class="fa fa-user"></i></a>';
283  }
284 
285  $key_column = array_search('email_confirmed', $columns);
286  foreach ($arr as $key => $item) {
287  $arr[$key][$key_column] = '<div class="text-center px-1">' . ($item[$key_column] ? '<i title="Email подтверждён" class="fa fa-check-circle text-success"></i>' : '<i title="Email не подтверждён" class="fa fa-times-circle text-secondary"></i>') . '</div>';
288  }
289  }
290 
291  if ($table == 'crontabs') {
292  $shedule_column = array_search('shedule', $columns);
293  $key_column = array_search('run_at', $columns);
294  foreach ($arr as $key => $item) {
295  $cron = CronExpression::factory($item[$shedule_column]);
296  $shedules = [];
297  for ($i = 0; $i < 10; $i++) {
298  $shedules[] = $cron->getNextRunDate(null, $i)->format('Y-m-d H:i:s');
299  }
300 
301  $arr[$key][$key_column] = '<div data-placement="left" title="<div class=\'text-left font-weight-bold\'>Расписание:</div><small style=\'line-height:1;\'>' . implode("<br>", $shedules) . '</small>">' . substr($shedules[0], 0, -3) . '</div>';
302  }
303 
304  $key_column = array_search('user_id', $columns);
305  foreach ($arr as $key => $item) {
306  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-performer" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
307  }
308 
309  $key_column = array_search('shedule', $columns);
310  foreach ($arr as $key => $item) {
311  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-shedule" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
312  }
313 
314  $key_column = array_search('headers', $columns);
315  foreach ($arr as $key => $item) {
316  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-headers" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
317  }
318 
319  $key_column = array_search('data', $columns);
320  foreach ($arr as $key => $item) {
321  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-data" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
322  }
323 
324  $key_column = array_search('method', $columns);
325  foreach ($arr as $key => $item) {
326  $arr[$key][$key_column] = '<div class="edit-wrapper editable-act" data-id="' . $item[0] . '" data-target="#edit-method" data-toggle="modal" data-table="' . $table . '">' . $item[$key_column] . '<i class="fa fa-edit"></i></div>';
327  }
328  }
329 
330  return $arr;
331  }
332 
333  /**
334  * фильтрация массива для таблиц выборок.
335  *
336  * @param array $arr Массив данных таблицы для форматирования.
337  * @param array $columns массив имен столбцов
338  * @param string $table Имя таблицы для редактирования.
339  *
340  * @return array $arr отфильтрованный массив данных
341  */
342  private static function filter($arr, $columns, $table)
343  {
344  if (!isset($_SESSION['filter'][$table])) {
345  return $arr;
346  }
347 
348  if ($key_column = array_search('act', $columns)) {
349  if (empty($_SESSION['filter'][$table]['act'])) {
350  return [];
351  }
352 
353  foreach ($arr as $key => $item) {
354  if (!in_array($arr[$key][$key_column], $_SESSION['filter'][$table]['act'])) {
355  unset($arr[$key]);
356  }
357  }
358  }
359 
360  if ($key_column = array_search('owner_group', $columns)) {
361  if (empty($_SESSION['filter'][$table]['owner_group'])) {
362  return [];
363  }
364 
365  foreach ($arr as $key => $item) {
366  if (!in_array($arr[$key][$key_column], $_SESSION['filter'][$table]['owner_group'])) {
367  unset($arr[$key]);
368  }
369  }
370  }
371 
372  if ($key_column = array_search('groups', $columns)) {
373  if (empty($_SESSION['filter'][$table]['groups'])) {
374  foreach ($arr as $key => $item) {
375  if (json_decode($arr[$key][$key_column], true)) {
376  unset($arr[$key]);
377  }
378  }
379  } else {
380  foreach ($arr as $key => $item) {
381  if (!array_intersect(json_decode($arr[$key][$key_column], true), $_SESSION['filter'][$table]['groups'])) {
382  unset($arr[$key]);
383  }
384  }
385  }
386  }
387 
388  if ($table == 'templates' && ($key_column = array_search('type', $columns))) {
389  $template_types = ['page', 'incode', 'modal', 'select', 'action'];
390  if (empty($_SESSION['filter'][$table]['type'])) {
391  return [];
392  }
393 
394  foreach ($arr as $key => $item) {
395  if (!in_array(array_search($arr[$key][$key_column], $template_types), $_SESSION['filter'][$table]['type'])) {
396  unset($arr[$key]);
397  }
398  }
399  }
400 
401  return $arr;
402  }
403 }
catch(\Throwable $th) $shedules
Definition: add-crontab.php:48
if(!($row=Wrong\Models\Crontabs::find($_POST['id']))) if(! $user->access() ->write($row)) $sth
Definition: edit-cli.php:20
if(!in_array($_POST['table'], Wrong\Database\Controller::$tables)) $table
Definition: filter.php:20
$_SESSION['filter']
Definition: filter.php:22
if(empty($_POST['name'])) if(empty($_POST['type'])||!in_array($_POST['type'], ['page', 'modal', 'incode', 'select', 'action'])) $i
Connect создает подключение к базе данных
Definition: Connect.php:19
static getInstance($ignore_error=false)
Definition: Connect.php:50
Controller контроллер для запросов к БД
Definition: Controller.php:17
static find($value, $column='id', $table='')
Definition: Controller.php:31
Path удаляет и очищает каталоги
Definition: Path.php:17
static mkdir($filename)
Definition: Path.php:23
static rmdir($filename)
Definition: Path.php:54
Actions контроллер управления моделями действий, расширяет Controller.
Definition: Actions.php:21
static name($id)
Definition: Actions.php:61
Selects контроллер управления моделями выборок, расширяет Controller.
Definition: Selects.php:26
static formatter($arr, $columns, $table)
Definition: Selects.php:68
static create($arr, $replace_path=[])
Definition: Selects.php:36
static filter($arr, $columns, $table)
Definition: Selects.php:342
static all_available($value='', $column='id', $table='')
Definition: Templates.php:68
Groups контроллер управления моделями пользователей, расширяет Controller.
Definition: Users.php:21
Group класс, содержащий статические методы, используемые для управления группами пользователей.
Definition: Group.php:25
static count_all_available_models($id)
Definition: Group.php:369
static text($id)
Definition: Group.php:233
static groupNamesText($json_groups)
Definition: Group.php:108
static count_all_owner_models($id, $is_active=false)
Definition: Group.php:352
static is_active($id)
Definition: Group.php:222
Env класс управляющий, добавляющий или записывающий переменные среды
Definition: Env.php:17
static $e
Definition: Env.php:22
$user
Definition: from-user.php:38
setcookie('FROM_UID', $uid, [ 'expires'=> time()+31536000, 'path'=> '/', 'domain'=> $_SERVER['HTTP_HOST'], 'secure'=> Wrong\Start\Env::$e->IS_SECURE, 'httponly'=> false, 'samesite'=> Wrong\Start\Env::$e->IS_SECURE ? 'None' :'Lax']) or setcookie('FROM_UID' $_SERVER['HTTP_HOST']
Definition: from-user.php:36
ModelsInterface интерфейс управления моделями
$owner_group
Definition: edit-groups.php:15
$columns
Definition: actions.php:14
$arr
Definition: actions.php:25
$dbh
Definition: session.php:19