actions_zone('before_form_page'); //Формирование страницы if (is_ajax()) { $PAGE->code = 'ajax_call'; } elseif (is_remote()) { $PAGE->code = 'remote_call'; } elseif (!$PAGE->code) { $key = get_current_key(); $PAGE->title = $APAGES[$key]->title; $PAGE->code = $key; } uasort($APAGES, 'collector_sort'); foreach ($APAGES as $item) { if (count($item->childs) > 1) { usort($item->childs, 'apage_sort_child'); } } uasort($SCRIPTS, 'collector_sort'); uasort($ACTIONS, 'collector_sort'); //Загрузка шаблонов if (!is_connect()) { actions_zone('before_template'); if ($APAGES[$PAGE->code]->skelet) { get_template('header.php'); } show_apage($PAGE->code); if ($APAGES[$PAGE->code]->skelet) { get_template('footer.php'); } actions_zone('after_template'); }
<?php add_apage(array('title' => 'Календарь событий', 'code' => 'calendar_event', 'parent' => '', 'rule' => 'calendar_event_admin', 'priority' => 30, 'category' => 'admin', 'function' => function () { get_module_template('panel.php'); })); add_apage(array('title' => 'Календарь событий', 'code' => 'calendar_event', 'rule' => 'public', 'priority' => 30, 'category' => 'public', 'function' => function () { get_module_template('public.php'); })); add_action(array('title' => 'Календарь событий', 'code' => 'remote_calendar_event', 'rule' => 'public', 'category' => 'public', 'function' => function ($params) { $_GET['month'] = isset($params['month']) ? $params['month'] : $_GET['month']; $_GET['year'] = isset($params['year']) ? $params['year'] : $_GET['year']; show_apage('calendar_event'); })); add_apage(array('title' => 'Календарь событий для обмена', 'code' => 'calendar_event_json', 'rule' => 'public', 'priority' => 30, 'category' => 'public', 'skelet' => false, 'function' => function () { show_calendar_events(array('links' => false, 'show' => 'json')); })); add_apage(array('title' => 'Добавить событие', 'category' => 'admin', 'code' => 'calendar_event_add', 'parent' => 'calendar_event', 'rule' => 'calendar_event_admin', 'priority' => -1, 'function' => function () { get_module_template('add.php'); })); add_script(array('type' => 'script', 'link' => get_module_file('js/jquery.datetimepicker.min.js'), 'priority' => '40', 'auto' => 'calendar_event_add', 'category' => 'admin', 'zone' => 'footer', 'code' => 'datetimepicker_js')); add_script(array('type' => 'style', 'link' => get_module_file('js/jquery.datetimepicker.min.css'), 'priority' => '35', 'auto' => 'calendar_event_add', 'category' => 'admin', 'zone' => 'footer', 'code' => 'datetimepicker_css')); add_script(array('type' => 'script', 'priority' => '49', 'auto' => 'calendar_event_add', 'category' => 'admin', 'zone' => 'footer', 'link' => 'http://momentjs.com/downloads/moment.min.js', 'code' => 'moment_js')); add_script(array('type' => 'script', 'priority' => '50', 'auto' => 'calendar_event_add', 'category' => 'admin', 'zone' => 'footer', 'code' => 'datetimepicker_doit', 'function' => function () { $option = get_option('calendar_events_range'); ?> <script> $(function(){ var time_start, time_end, min = null, max = null; var ID = ($('[name="event_ID"]:first-of-type').length) ? $('[name="event_ID"]:first-of-type').val() : ''; function check_calendar_events_near() {