Ejemplo n.º 1
0
function set_glob_content($par)
{
    global $PAGE, $DETDB;
    $par = take_good_array($par);
    $custom =& $PAGE->content;
    $custom = set_merge($custom, $par);
    if ($custom['pagi']) {
        if ($custom['current'] === null) {
            $custom['current'] = get_pagination_number();
        }
        if ($custom['offset'] === null) {
            $custom['offset'] = $custom['limit'] * ($custom['current'] - 1);
        }
    }
    if ($custom['handler']) {
        $pre = null;
        if (is_string($custom['handler'])) {
            $pre = make_action($custom['handler'], $custom);
        } elseif (is_callable($custom['handler'])) {
            $pre = call_user_func($custom['handler'], $custom);
        }
        if ($pre && (is_object($pre) || is_array($pre))) {
            $custom = set_merge($custom, $pre, true);
        }
    }
    if ($custom['pagi'] && $custom['all'] === null) {
        $custom['all'] = isset($par['table']) ? $DETDB->count($par['table']) : 1;
    }
    if ($custom['body'] == '' && isset($par['table'])) {
        if ($custom['pagi']) {
            $par['offset'] = $custom['offset'];
            $par['limit'] = $custom['limit'];
        }
        $custom['body'] = $DETDB->select($par);
    }
    if ($custom['pagi'] && $custom['all'] && $custom['limit'] && ceil($custom['all'] / $custom['limit']) < $custom['current']) {
        redirect(get_current_key(), true);
    }
}
Ejemplo n.º 2
0
<?php

$month = isset($_GET['month']) ? $_GET['month'] : date('m');
?>

<div id="calendar_events">
    <form methot="GET">
        <input type="hidden" name="page" value="<?php 
echo get_current_key();
?>
" />
        <select name="month" onchange="this.form.submit()">
            <?php 
foreach (get_calendar_months() as $key => $item) {
    echo '<option value="' . $key . '"' . ($key == $month ? ' selected' : '') . '>' . $item . '</option>';
}
?>
        </select>
    </form>

    <?php 
show_calendar_events(array('month' => $month, 'links' => false));
?>
</div>
Ejemplo n.º 3
0
        if (!isset($message[2])) {
            $message[2] = 'Внимание!';
        }
        push_output_message(array('title' => $message[2], 'type' => $message[0], 'text' => $message[1], 'class' => "message-generate alert alert-{$message[0]}"));
    }
    unset($message);
    destroy_cookie('reload_message');
}
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) {
Ejemplo n.º 4
0
    if ($event) {
        $start_date = date('Y-m-d H:i', strtotime($event['date_start']) - 36000);
        $end_date = $event['date_end'] && $event['date_end'] > 0 ? date('Y-m-d H:i', strtotime($event['date_end']) + 36000) : date('Y-m-d H:i', strtotime($event['date_start']) + 36000);
        show_calendar_events(array('limit' => 15, 'exclude_ID' => isset($event['ID']) ? $event['ID'] : '', 'start' => $start_date, 'end' => $end_date, 'type' => 'range'));
    }
    ?>
        </div>
    </div>
    <br />
<?php 
}
?>

<div id="add_event">
    <form method="POST" action="index.php?page=<?php 
echo get_current_key() . (isset($event['ID']) ? '&event_id=' . $event['ID'] : '');
?>
">
        <fieldset>
            <legend>Общая информация</legend>
            <div class="row">
                <div class="field form-group col-lg-8">
                    <label>Наименование  мероприятия</label>
                    <textarea name="name" class="editor editor-mini form-control" rows="5"><?php 
echo $event['name'];
?>
</textarea>
                </div>
            </div>
            <div class="row">
                <div class="field form-group col-lg-8">