Exemplo n.º 1
0
theme::table_tabs($records['records']);
theme::table_tabs_start();
foreach ($records['records'] as $tab => $tab_records) {
    theme::table_tab_pane_start($tab);
    theme::table_start(['Name', 'Value', 'Managed' => 'text-center', 'Actions' => 'text-center']);
    /* show them in the order they where entered */
    uasort($tab_records, function ($a, $b) {
        return $a->id > $b->id ? 1 : -1;
    });
    foreach ($tab_records as $record) {
        theme::table_start_tr();
        echo !$record->enabled ? '<i class="text-muted">' : '';
        o::e($record->name);
        echo !$record->enabled ? '</i>' : '';
        theme::table_row();
        echo theme::format_value($record->value, 128);
        theme::table_row('larger text-center');
        echo theme::enum_icon((int) $record->managed);
        theme::table_row('actions text-center');
        if ($record->is_editable) {
            theme::table_action('edit', $this->controller_path . '/edit/' . $record->id);
        }
        if (has_access('orange::advanced settings')) {
            theme::table_action('pencil-square', $this->controller_path . '/edit/' . $record->id . '/advanced');
        }
        if ($record->is_deletable) {
            o_dialog::confirm_a_delete($this->controller_path . '/delete/' . $record->id);
        }
        theme::table_end_tr();
    }
    theme::table_end();
Exemplo n.º 2
0
 public static function looper($all, $which)
 {
     $overridden_icon = '<i class="fa fa-exchange"></i>';
     $controller_path = ci()->page->data('controller_path');
     $inp = $all[$which];
     if (count($inp) > 0) {
         echo '<table class="table table-condensed" style="margin:0">';
         foreach ($inp as $name => $value) {
             $show_as = 0;
             /* text area default */
             $overridden = '&nbsp;';
             $link = '&nbsp;';
             switch ($which) {
                 case 'db':
                     if ($all['db'][$name] != $all['env'][$name] && isset($all['env'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     if ($all['db'][$name] != $all['file'][$name] && isset($all['db'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
                 case 'env':
                     if ($all['env'][$name] != $all['file'][$name] && isset($all['file'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
                 case 'file':
                     if ($all['file'][$name] != $all['env'][$name] && isset($all['env'][$name])) {
                         $overridden = $overridden_icon;
                     }
                     break;
             }
             $group = ci()->uri->segment(5);
             switch (gettype($value)) {
                 case 'string':
                 case 'integer':
                 case 'null':
                 case 'float':
                     break;
                 case 'boolean':
                     $show_as = 1;
                     /* true / false radio's */
                     break;
             }
             if (!ci()->o_setting_model->compound_key_exists($name, $group) && $which == 'merged') {
                 $hash = bin2hex($name . chr(0) . convert_to_string($value) . chr(0) . $group . chr(0) . $show_as);
                 $link = '<a class="js-add-link" href="' . $controller_path . '/add/' . $hash . '"><i class="fa fa-plus-square"></i></a>';
             }
             echo '<tr>';
             echo '<td width="47%">' . $name . '&nbsp;</td>';
             echo '<td style="width:47%;">' . theme::format_value($value) . '</td>';
             echo '<td style="width:3%; text-align:center">' . $link . '</td>';
             echo '<td style="width:3%; text-align:center">' . $overridden . '</td>';
             echo '</tr>';
         }
         echo '</table>';
     }
 }