Exemplo n.º 1
0
<?php

theme::header_start('Banners', 'mange banners.');
Plugin_search_sort::field();
if (has_access('templates::add')) {
    theme::header_button('new');
}
theme::header_end();
theme::table_start(['Title', 'Starts After', 'End After', 'Points To', 'Weight' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $key => $record) {
    theme::table_start_tr();
    theme::e($record->title);
    theme::table_row();
    theme::date($record->start_on);
    theme::table_row();
    theme::date($record->end_on);
    theme::table_row();
    theme::e($record->url);
    theme::table_row('text-center');
    theme::e($record->weight);
    theme::table_row('actions text-center');
    if ($record->is_editable) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if ($record->is_deletable) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
Exemplo n.º 2
0
<?php

theme::header_start('Manage ' . $controller_titles, 'Manage all ' . $controller_titles . '. <span id="servertime"></span>');
Plugin_search_sort::field();
theme::header_button('new');
theme::header_end();
theme::table_start(['Enabled' => 'text-center', 'Description', 'When', 'URL', 'Keep' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr('', 'text-center');
    theme::enum_icon($record->is_enabled);
    theme::table_row();
    theme::e($record->description);
    theme::table_row();
    $time = trim($record->minute . ' ' . $record->hour . ' ' . $record->day_of_month . ' ' . $record->month . ' ' . $record->day_of_week);
    try {
        $cron = Cron\CronExpression::factory($time);
        echo 'Previous: ' . $cron->getPreviousRunDate()->format("F j, Y, g:i a") . '<br>Next: ' . $cron->getNextRunDate()->format("F j, Y, g:i a");
    } catch (Exception $e) {
        echo '<span class="text-danger">Invalid trigger ' . $time . '</span>';
    }
    theme::table_row();
    theme::e($record->url);
    theme::table_row('text-center');
    theme::e($record->keep);
    theme::table_row('actions text-center');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    theme::table_action('eye', $this->controller_path . '/view/' . $record->id);
    theme::table_end_tr();
}
theme::table_end();