1: <?php namespace Laravella\Crud;
2:
3: use Laravella\Crud\CrudSeeder;
4:
5: class PostCrudSeeder extends CrudSeeder {
6:
7: public function run()
8: {
9:
10:
11:
12: $this->addPage('_db_severities', 'getSelect', null, array('title'=>'Severities'));
13: $this->addPage('_db_pages', 'getSelect', null, array('title'=>'Pages'));
14: $this->addPage('_db_tables', 'getSelect', null, array('title'=>'Tables'));
15: $this->addPage('_db_user_permissions', 'getSelect', null, array('title'=>'User Permissions'));
16: $this->addPage('_db_usergroup_permissions', 'getSelect', null, array('title'=>'Usergroup Permissions'));
17: $this->addPage('_db_views', 'getSelect', null, array('title'=>'Views'));
18: $this->addPage('_db_widget_types', 'getSelect', null, array('title'=>'Widget Types'));
19: $this->addPage('_db_actions', 'getSelect', null, array('title'=>'Actions'));
20: $this->addPage('_db_audit', 'getSelect', null, array('title'=>'Audit'));
21: $this->addPage('_db_display_types', 'getSelect', null, array('title'=>'Display Types'));
22: $this->addPage('_db_fields', 'getSelect', null, array('title'=>'Fields'));
23: $this->addPage('_db_logs', 'getSelect', null, array('title'=>'Logs'));
24: $this->addPage('_db_menu_permissions', 'getSelect', null, array('title'=>'Menu Permissions'));
25: $this->addPage('_db_menus', 'getSelect', null, array('title'=>'Menus'));
26: $this->addPage('_db_option_types', 'getSelect', null, array('title'=>'Option Types'));
27: $this->addPage('_db_options', 'getSelect', null, array('title'=>'Options'));
28: $this->addPage('_db_keys', 'getSelect', null, array('title'=>'Keys'));
29: $this->addPage('_db_key_fields', 'getSelect', null, array('title'=>'Key Fields'));
30: $this->addPage('_db_key_types', 'getSelect', null, array('title'=>'Key Types'));
31: $this->addPage('_db_objects', 'getSelect', null, array('title'=>'Objects'));
32: $this->addPage('_db_assets', 'getSelect', null, array('title'=>'Assets'));
33: $this->addPage('_db_events', 'getSelect', null, array('title'=>'Events'));
34:
35:
36: $nodisplayId = $this->getId('_db_display_types', 'name', 'nodisplay');
37: $this->updateOrInsert('_db_fields', array('fullname'=>'contents.content_mime_type'), array('display_type_id'=>$nodisplayId));
38:
39: $widgetId = $this->getId('_db_display_types', 'name', 'widget');
40: $checkboxId = $this->getId('_db_widget_types', 'name', 'input:checkbox');
41: $this->updateOrInsert('_db_fields', array('fullname'=>'medias.approved'), array('display_type_id'=>$widgetId, 'widget_type_id'=>$checkboxId));
42: $this->updateOrInsert('_db_fields', array('fullname'=>'medias.publish'), array('display_type_id'=>$widgetId, 'widget_type_id'=>$checkboxId));
43:
44:
45: $this->updateOrInsert('_db_fields', array('fullname'=>'contents.lang'), array('label'=>'Language'));
46: $this->updateOrInsert('_db_fields', array('fullname'=>'contents.title'), array('display_order'=>'0'));
47:
48: $ugId = $this->getId('usergroups', 'group', 'admin');
49: $mId = $this->getId('_db_menus', 'label', 'Meta Data');
50: $this->delete('_db_menu_permissions', array('usergroup_id'=>$ugId, 'menu_id'=>$mId));
51: $mId = $this->getId('_db_menus', 'label', 'Menus');
52: $this->delete('_db_menu_permissions', array('usergroup_id'=>$ugId, 'menu_id'=>$mId));
53:
54: echo "Crud::PostCrudSeeder done.";
55:
56: }
57:
58: }