Exemple #1
0
<?php

theme::header_start($controller_titles, 'manage random bits of text.');
Plugin_search_sort::field();
if (has_access('Snippets::Add Snippets')) {
    theme::header_button('new');
}
theme::header_end();
theme::table_start(['Name', 'Value', 'Note', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->name);
    theme::table_row();
    theme::shorten($record->value);
    theme::table_row();
    theme::shorten($record->note);
    theme::table_row('actions text-center');
    if ($record->is_editable && has_access('Snippets::Edit Snippets')) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if ($record->is_deletable && has_access('Snippets::Delete Snippets')) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
<?php

theme::header_start($controller_titles, 'Manage ' . strtolower($controller_titles) . '.');
Plugin_search_sort::field();
if (has_access('Content::Add Pages')) {
    theme::header_button('new');
}
theme::header_end();
theme::table_start(['Title', 'Internal', 'Is Visible' => 'text-center', 'Actions' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->title);
    theme::table_row();
    theme::shorten($record->internal);
    theme::table_row('text-center');
    theme::enum_icon($record->is_visible);
    theme::table_row('actions text-center');
    if ($record->is_editable) {
        theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
    }
    if ($record->is_deletable && has_access('Pages::Delete Pages')) {
        o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
    }
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
<?php

theme::header_start('Lock Settings', 'protect the following records form accidental import updates.');
Plugin_search_sort::field();
theme::header_button('back', ['href' => $controller_path]);
theme::header_end();
theme::table_start(['Group', 'Name', 'Value', 'Locked' => 'text-center'], [], $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->group);
    theme::table_row();
    theme::e($record->name);
    theme::table_row();
    theme::shorten($record->value, 64);
    //theme::smart_model('o_access',$record->access_id,'key');
    theme::table_row('text-center');
    $checked = $record->is_locked ? 'checked' : '';
    echo '<input type="checkbox" value="1" class="select" data-id="' . $record->id . '" data-m="0" ' . $checked . '>';
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
<?php

theme::form_start($controller_path . '/settings', null, ['data-validate' => false]);
theme::header_start('Export Settings');
Plugin_search_sort::field();
theme::header_button('Export File', ['icon' => 'upload', 'action' => 'js-post']);
theme::header_button('back');
theme::header_end();
theme::table_start(['Name', 'Value', 'Export' => 'text-center'], [], $records);
$group = '';
foreach ($records as $record) {
    if ($group != $record->group) {
        echo '<tr><td colspan="4"><strong>Grouping: ' . $record->group . '</strong></td></tr>';
        $group = $record->group;
    }
    theme::table_start_tr();
    theme::e($record->name);
    theme::table_row();
    theme::shorten($record->value, 256);
    theme::table_row('actions text-center');
    echo '<input type="checkbox" name="export[]" value="' . $record->id . '">';
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
theme::form_end();
<?php

theme::header_start('Manage Zones');
theme::header_button('new');
theme::header_end();
theme::table_start(['Name', 'Description', 'Active' => 'txt-ac', 'Actions' => 'txt-ac'], null, $records);
foreach ($records as $record) {
    $record->id = $record->lzone_id;
    theme::table_start_tr();
    theme::e($record->lzone_name);
    theme::table_row();
    theme::shorten($record->lzone_description);
    theme::table_row('txt-ac');
    theme::enum_icon($record->lzone_status);
    theme::table_row('actions txt-ac');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->lzone_id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->lzone_id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();
<?php

theme::header_start('Manage Currencies', 'Manage your stores currency.');
theme::header_button('new');
theme::header_end();
theme::table_start(['Name', 'Exchange Rate', 'Symbol' => 'text-center', 'Suffix' => 'text-center', 'Thousand' => 'text-center', 'Decimal' => 'text-center', 'Status' => 'text-center', 'Actions' => 'text-center'], null, $records);
foreach ($records as $record) {
    theme::table_start_tr();
    theme::e($record->curr_name);
    theme::table_row();
    theme::shorten($record->curr_exchange_rate);
    theme::table_row('text-center');
    theme::shorten($record->curr_symbol);
    theme::table_row('text-center');
    theme::enum_icon($record->curr_symbol_suffix);
    theme::table_row('text-center');
    theme::shorten($record->curr_thousand_separator);
    theme::table_row('text-center');
    theme::shorten($record->curr_decimal_separator);
    theme::table_row('text-center');
    theme::enum_icon($record->curr_status);
    theme::table_row('actions text-center');
    theme::table_action('edit', $this->controller_path . '/edit/' . $record->curr_id);
    o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->curr_id);
    theme::table_end_tr();
}
theme::table_end();
theme::return_to_top();