public function delete($type) { DB::load()->delete('Users', array(array('ID', '=', Input::get('ID')))); DB::load()->delete('Posts', array(array('User_ID', '=', Input::get('ID')))); DB::load()->delete('Meta_items', array(array('User_ID', '=', Input::get('ID')))); Session::set('SUCCESS', I18n::get('SYSTEM_CRUD_SUCCESS')); Redirect::to(Input::get('current')); }
public function delete($type) { if (Input::exists()) { DB::load()->delete('Menus', array(array('ID', '=', Input::get('ID')))); Session::set('SUCCESS', I18n::get('SYSTEM_CRUD_SUCCESS')); Redirect::to(Input::get('current_url')); } Redirect::back(); }
public function delete($type) { var_dump($this); die; PostMetaModel::load()->delete('Post_ID', Input::get('id')); UploadItemModel::load()->delete('Post_ID', Input::get('id')); PostModel::load($type)->delete('ID', Input::get('ID')); Session::set('SUCCESS', I18n::get('SYSTEM_CRUD_SUCCESS')); Redirect::to($this->project_url . "admin/read/post/{$type}/"); }
public function delete($type) { if (Input::exists()) { $source = PATH_ROOT . 'public/uploads/source/'; $thumbs = PATH_ROOT . 'public/uploads/thumbs/'; $upload = DB::load()->select(array('ID, Slug'), 'Uploads', null, array(array('ID', '=', Input::get('ID'))))->results(); $file = $upload[0]->Slug; Upload::load($source)->remove($file); Upload::load($source)->remove($file, $thumbs); DB::load()->delete('Uploads', array(array('ID', '=', Input::get('ID')))); Session::set('SUCCESS', I18n::get('SYSTEM_CRUD_SUCCESS')); } Redirect::to($this->data['project_url'] . 'admin/read/uploads'); }
public function logout() { Auth::load()->logout(); Session::set('SUCCESS', I18n::get('AUTH_LOGOUT')); Redirect::to($this->data['project_url'] . 'login#form'); }
<?php // load the class require_once '../src/I18n.php'; // use class use WebSupportDK\PHPMultilingual\I18n; // make language files in form of array in path/to/language/en/US.php, en/UK.php etc return array('VIEW_TEST' => 'This is a test!'); // set the local for the class in form of "en_US" (could be set by a cookie or session at run-time) I18n::set($locale = 'en_US'); // register alle the locations of the language files with a token I18n::register($path = 'path/to/language', $token = 'test'); // return the string of the language with the token // the first part (before '_') tells the path, and the rest (after '_') tells the key I18n::get('VIEW_TEST'); // output/echo the string I18n::get('VIEW_TEST', false);