コード例 #1
0
ファイル: SFVideos.php プロジェクト: nagyist/abge
 public function getBitURI()
 {
     return $this->id_video . '-' . substr(BaseController::remove_spaces(ucwords(BaseController::remove_accents($this->titulo_video))), 0, 7);
 }
コード例 #2
0
ファイル: NewsController.php プロジェクト: nagyist/abge
 public function postUpdate($id)
 {
     $news = SFNews::find($id);
     $image = Input::file('image');
     $image_principal = Input::file('image_principal');
     $validator = Validator::make(array('image' => $image, 'image_principal' => $image_principal), array('image' => 'mimes:png,jpeg,gif', 'image_principal' => 'mimes:png,jpeg,gif'), array('mimes' => 'Tipo de imagen inválido, solo se admite los formatos PNG, JPEG, y GIF'));
     if ($validator->fails()) {
         return Redirect::to($this->route . '/create')->with('msg_err', Lang::get('messages.companies_create_img_err'));
     } else {
         if ($image != "") {
             $image = $this->uploadHeader($image);
         } else {
             $image = $news->image;
         }
         if ($image_principal != "") {
             $image_principal = $this->uploadHeader($image_principal);
         } else {
             $image_principal = $news->image_principal;
         }
         $news->id_profile = 1;
         $news->status = 1;
         $news->home = 1;
         $news->author = 'ABGE';
         $news->sticky = 0;
         $news->category = Input::get('category');
         $news->title = Input::get('title');
         $news->sub_title = Input::get('sub_title');
         $news->home_title = Input::get('home_title');
         $news->summary = Input::get('summary');
         $news->body = Input::get('body');
         $news->date = date("Y-m-d", strtotime(Input::get('date')));
         $news->author = Input::get('author');
         $news->image = $image;
         $news->image_principal = $image_principal;
         $news->save();
         $news->permalink = $news->id_news . '-' . substr(BaseController::guide_spaces(strtolower(BaseController::remove_accents($this->title))), 0, 50);
         $news->save();
         return Redirect::to($this->route)->with('msg_success', Lang::get('messages.companies_edit', array('title' => $news->title)));
     }
 }
コード例 #3
0
ファイル: SFAlbum.php プロジェクト: nagyist/abge
 public function getBitURI()
 {
     return $this->id_album . '-' . substr(BaseController::remove_spaces(ucwords(BaseController::remove_accents($this->album_name))), 0, 7);
 }