Example #1
0
 function postSet($table_name)
 {
     $table = Database::import_or_new()->table($table_name);
     foreach (Input::get('col')[$table_name] as $col_name => $col_settings) {
         $col = $table->col($col_name);
         foreach ($col_settings as $key => $value) {
             $col->{$key} = $value;
         }
     }
     $table->export();
     return redirect()->action('TableController@getSet', ['t' => $table_name]);
 }
 function getCreateAll()
 {
     $db = Database::import_or_new(NULL);
     $tables = $db->tables;
     foreach ($tables as $table) {
         $page_name = $table->name;
         $page = Page::import_or_new_with($page_name, ['db' => $db, 'base_table' => $table]);
         if ($page->is_imported) {
             continue;
         }
         $table = $page->table($table->name);
         $page->user_group_permissions("");
         $page->export();
     }
     return redirect()->action("TableController@getIndex")->with('message_type', 'success')->with('message', 'Success!');
 }