Beispiel #1
0
 /**
  * Save slide caption and alt text for current language
  *
  * @param Request $request
  * @param $id
  */
 public function postAjaxSlideContentSave(Request $request, $id)
 {
     $lng_id = (int) $request->input('current-lng-id');
     $slideId = (int) $id;
     $slideContent = SlideTrl::OneTrlContent($slideId, $lng_id)->first();
     if (empty($slideContent)) {
         $slideContent = new SlideTrl();
         $slideContent->lng_id = $lng_id;
         $slideContent->slide_id = $slideId;
     }
     $slideContent->slide_alt = trim($request->input('alt'));
     $slideContent->slide_html = trim($request->input('text-area'));
     if ($slideContent->save()) {
         $partial = View::make('admin.slides.ajax._edit_slide_success', compact('lng_id', 'slideId'))->render();
         return (string) $partial;
     } else {
         //error
     }
 }