public function index() { $this->template->tables = $this->table_names; $grants = new \WordPress\Tabulate\DB\Grants(); $this->template->roles = $grants->get_roles(); $this->template->grants = $grants->get(); $this->template->capabilities = $grants->get_capabilities(); $this->template->form_action = $this->get_url('save'); return $this->template->render(); }
protected function table_format(Table $table, $attrs) { $template = new Template('data_table.html'); $template->table = $table; $template->links = false; $template->record = $table->get_default_record(); $template->records = $table->get_records(false); return $template->render(); }
public function index($args) { $db = new Database($this->wpdb); $tables = $db->get_tables(); $template = new Template('schema.html'); $template->tables = $tables; $template->managed_tables = get_option(TABULATE_SLUG . '_managed_tables', array()); if (isset($args['schema'])) { $template->schema = $db->get_table($args['schema']); } $template->types = array('varchar' => 'Text (short)', 'text' => 'Text (long)', 'int' => 'Number', 'date' => 'Date', 'fk' => 'Cross reference'); return $template->render(); }