/** * 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'); }
/** * 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); }
/** * 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); }
/** * 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); }
/** * 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'))); }
/** * 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')); }
/** * 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(); }
/** * 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')); }
/** * 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'); }
/** * Set the title for the sessions * @Developer brandon * @Date Oct 11, 2010 */ public function __construct() { parent::__construct(); meta::set_title('Login or Register'); }
/** * 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); }
/** * Contact Form * @Developer brandon * @Date May 19, 2010 */ public function contact() { meta::set_title('Contact Us'); $this->template->set('content', View::factory('statics/contact')); }
/** * 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'); }