Beispiel #1
0
 /**
  * Show the login page
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function new_one()
 {
     if (user::logged_in()) {
         url::redirect('');
     }
     parent::new_one();
     layout::add(View::factory('shared/mentions')->render(), 'pre_footer');
     meta::set_title('Login');
 }
Beispiel #2
0
 /**
  * Make sure that the one to update belongs to the user
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function edit($id = NULL)
 {
     $journal = ORM::factory('journal', $id);
     if ($journal->user->id != user::current()->id) {
         url::redirect('');
     }
     meta::set_title(date::user_friendly_date($journal->created_at) . ' : ' . $journal->title);
     parent::edit($id);
 }
Beispiel #3
0
 /**
  * Clean up the show page URL
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function show($name = NULL)
 {
     $blog = ORM::factory('blog')->where('name', format::dash_to_space($name))->find();
     // Set the title
     meta::set_title(ucwords($blog->name));
     // Set the description
     meta::set_description($blog->synopsis);
     // Show the page
     parent::show($blog);
 }
Beispiel #4
0
 /**
  * Clean up the show page URL
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function show($id = NULL)
 {
     // Find the product that we are trying to access
     $product = ORM::factory('product', $id);
     // Set the title
     meta::set_title(ucwords($product->name));
     // Set the description
     meta::set_description($product->description);
     // Show the page
     parent::show($product);
 }
Beispiel #5
0
 /**
  * Require administrator login
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     $this->template = View::factory('layouts/admin');
     meta::set_title(store::name() . ' | Admin | ' . ucwords(Router::$controller));
     // Set the route for updating and creating files
     Kohana::config_set('routes.base_crud_route', 'admin/');
     // Require an admin login if we are in production.
     if (IN_PRODUCTION) {
         customer::require_admin_login();
     }
     ORM::factory('audit_trail')->create(array('user_id' => customer::current(), 'store_id' => store::get(), 'controller' => Router::$controller, 'method' => Router::$method, 'object_id' => $this->input->post('id')));
 }
Beispiel #6
0
 /**
  * Display the missing page url
  * @Developer Brandon Hansen
  * @Date April 19, 2010
  */
 public function error_404()
 {
     header('HTTP/1.0 404 Not Found');
     meta::set_title('This Page will be Forever Missed');
     $this->template->set('title', 'Missing Page')->set('content', View::factory('errors/404'));
 }
Beispiel #7
0
 /**
  * Set the title for the cart
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Shopping Cart');
     $this->cart = cart::get();
 }
Beispiel #8
0
 /**
  * Set the home page
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function home()
 {
     meta::set_title('Welcome');
     $this->template->set('content', View::factory('themes/' . theme::get() . '/home'));
 }
Beispiel #9
0
 /**
  * Load up the controller
  * @developer Brandon Hansen
  * @date Jun 8, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Remembering Life');
     layout::add(View::factory('shared/mentions')->render(), 'pre_footer');
 }
Beispiel #10
0
 /**
  * Set the title for the sessions
  * @Developer brandon
  * @Date Oct 11, 2010
  */
 public function __construct()
 {
     parent::__construct();
     meta::set_title('Login or Register');
 }
Beispiel #11
0
 /**
  * Set the title for the blog entry that the user is viewing
  * @Developer brandon
  * @Date May 27, 2010
  */
 public function show($id = NULL)
 {
     parent::show($id);
     $blog = ORM::factory('blog', $id);
     meta::set_title($blog->title);
 }
Beispiel #12
0
 /**
  * Contact Form
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function contact()
 {
     meta::set_title('Contact Us');
     $this->template->set('content', View::factory('statics/contact'));
 }
Beispiel #13
0
 /**
  * Edit the user
  * @Developer brandon
  * @Date May 19, 2010
  */
 public function edit()
 {
     user::require_login();
     parent::edit(user::current()->id);
     meta::set_title('Update Account');
 }