public function editar()
 {
     //Aca se manda a la funcion editarItem de la clase Item
     //y se queda con la respuesta para redirigir cual sea el caso
     $respuesta = TextoHtml::editar(Input::all());
     if ($respuesta['error'] == true) {
         return Redirect::to('admin/item')->withErrors($respuesta['mensaje'])->withInput();
     } else {
         $menu = $respuesta['data']->item()->seccionItem()->menuSeccion()->lang()->url;
         $ancla = '#' . $respuesta['data']->item()->seccionItem()->estado . $respuesta['data']->item()->seccionItem()->id;
         return Redirect::to($this->array_view['prefijo'] . '/' . $menu)->with('mensaje', $respuesta['mensaje'])->with('ancla', $ancla);
         //return Redirect::to('admin/item')->with('mensaje', $respuesta['mensaje']);
     }
 }
Example #2
0
 public function lang()
 {
     $lang = Idioma::where('codigo', App::getLocale())->where('estado', 'A')->first();
     $html = TextoHtml::join('html_lang', 'html_lang.html_id', '=', 'html.id')->where('html_lang.lang_id', $lang->id)->where('html.id', $this->id)->first();
     if (is_null($html)) {
         echo "Por null";
         $lang = Idioma::where('codigo', 'es')->where('estado', 'A')->first();
         $html = TextoHtml::join('html_lang', 'html_lang.html_id', '=', 'html.id')->where('html_lang.lang_id', $lang->id)->where('html.id', $this->id)->first();
     }
     return $html;
 }
Example #3
0
 public function html()
 {
     return TextoHtml::where('item_id', $this->id)->first();
 }