Advertisement
Guest User

Untitled

a guest
Jun 29th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.43 KB | None | 0 0
  1.  <?php defined('SYSPATH') or die('No direct script access.');
  2.  
  3.   class Controller_Admin extends Controller_Layout {
  4.    
  5.        
  6.  
  7.     public function action_home()
  8.     {
  9.         $this->template->title = __('Control Panel Home');
  10.         $this->template->content = View::factory('admin/home' );
  11.         $this->template->sidebar = View::factory('admin/sidebar');
  12.     }
  13.    
  14.     public function action_addgame()
  15.     {
  16.         $genres=Model::factory('genre')->fetchgenres();
  17.         $this->template->title = __('Add New Game');
  18.         $this->template->content = View::factory('admin/addgame' )
  19.             ->bind('genres',$genres);
  20.         $this->template->sidebar = View::factory('admin/sidebar');
  21.     }
  22.    
  23.     public function action_managegames($filter)
  24.     {
  25.         $gamelist=Model::factory('game')->listgames($filter);
  26.         $genres=Model::factory('genre')->fetchgenres();
  27.         $this->template->title = __('Game List');
  28.         $this->template->content = View::factory('admin/gamelist')
  29.             ->set('gamelist',$gamelist)
  30.             ->set('genres',$genres);
  31.         $this->template->sidebar = View::factory('admin/sidebar');
  32.     }
  33.    
  34.     public function action_edit($gameid)
  35.     {
  36.         $genres=Model::factory('genre')->fetchgenres();
  37.         $game=Model::factory('game')->fetchgame($gameid);
  38.         $this->template->title = __('Edit Game');
  39.         $this->template->content = View::factory('admin/addgame' )
  40.             ->set('editgame',$game)
  41.             ->set('genres',$genres);
  42.         $this->template->sidebar = View::factory('admin/sidebar');
  43.     }
  44.    
  45.   }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement