public function run() { // Reset table DB::table('block_page')->truncate(); $order_id = Pongo::system('default_order'); DB::table('block_page')->insert(array(array('page_id' => 1, 'block_id' => 1, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 1, 'block_id' => 2, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 1, 'block_id' => 3, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 2, 'block_id' => 1, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 2, 'block_id' => 2, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 2, 'block_id' => 3, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 3, 'block_id' => 1, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 3, 'block_id' => 3, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 4, 'block_id' => 2, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 5, 'block_id' => 4, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 5, 'block_id' => 5, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 5, 'block_id' => 6, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 6, 'block_id' => 4, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 6, 'block_id' => 5, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 6, 'block_id' => 6, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 7, 'block_id' => 4, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 7, 'block_id' => 6, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1), array('page_id' => 8, 'block_id' => 5, 'zone' => 'ZONE1', 'order_id' => $order_id, 'is_active' => 1))); }
public function run() { DB::statement('SET FOREIGN_KEY_CHECKS = 0'); // disable foreign key constraints // Reset table DB::table('roles')->truncate(); $roles = Pongo::system('roles'); foreach ($roles as $name => $level) { $role = array('name' => $name, 'level' => $level); DB::table('roles')->insert($role); } DB::statement('SET FOREIGN_KEY_CHECKS = 1'); // enable foreign key constraints }
/** * [onCreate description] * @param [type] $block [description] * @param [type] $page_id [description] * @return [type] [description] */ public function onCreate($block, $page_id, $zone) { // Add record to pivot table 'block_page' $block->pages()->attach($page_id, array('zone' => $zone, 'order_id' => \Pongo::system('default_order'), 'is_active' => 0)); }
/** * Render PongoCMS main menu * Based on config/system.php sections array * * @param array $sections * @return void */ public function sectionMenu($sections = array()) { $menu_view = $this->view('partials.items.menuitem'); $menu_view['sections'] = !empty($sections) ? $sections : \Pongo::system('sections'); return $menu_view; }
public function loadThumb($path, $thumb = 'cms', $alt = '') { $file_name = $this->getFileName($path); if ($this->isImage($file_name)) { $thumb_name = $this->formatFileThumb($file_name, $thumb); $thumb_path = str_replace($file_name, $thumb_name, $path); $w = \Pongo::system($thumb . '.width'); $h = \Pongo::system($thumb . '.height'); $output = \HTML::image($thumb_path, $alt, array('class' => 'cms-thumb', 'width' => $w, 'height' => $h)); } else { $ext = $this->fileExtension($file_name); $ico = \Pongo::settings('mimes.' . $ext); $output = '<span class="cms-thumb"><i class="' . $ico . '"></i></span>'; } return $output; }