$(".fotorama") .on("fotorama:show", function (e, fotorama) { fotorama.$caption = fotorama.$caption || $(this).next(".fotorama-caption"); fotorama.$caption.text(fotorama.activeFrame.caption); }) .fotorama(); </script> <?php echo '<h4>' . $artista->nombre . ' ' . $artista->apellido . '</h4>'; echo '<!-- Fotorama --> <div class="fotorama" data-width="700" data-max-width="100%" data-ratio="500/333" data-fit="contain" data-thumbfit="contain" data-captions="false" data-auto="false" data-nav="thumbs"> '; foreach ($obras as $obra) { if (Yii::app()->sourceLanguage == Yii::app()->language) { $descripcion = $obra->descripcion; } else { $descripcion = TraObra::model()->find('idiomaid=:ididioma AND obraid=:idobra', array(':ididioma' => $idioma->id, ':idobra' => $obra->idobra))->descripcion; } //$descripcion = $obra->traObras->obraid; $this->widget('ext.SAImageDisplayer', array('image' => $obra->imagen, 'size' => 'grande', 'defaultImage' => 'default.png', 'group' => 'obra', 'othersAttributes' => array('data-caption' => $descripcion))); } echo ' </div> <!--Caption--> <div style="min-height:40px; line-height: 20px; padding-top:10px" class="fotorama-caption"> </div>'; ?>
/** * Updates a particular model. * If update is successful, the browser will be redirected to the 'view' page. * @param integer $id the ID of the model to be updated */ public function actionUpdate($id) { $model = $this->loadModel($id); $tra_obra = TraObra::model()->find('obraid=:id AND idiomaid=:idiomaid', array(':id' => $id, ':idiomaid' => 2)); // Uncomment the following line if AJAX validation is needed // $this->performAjaxValidation($model); if (isset($_POST['Obra'])) { $model->attributes = $_POST['Obra']; if ($model->save()) { $tra_obra->descripcion = $model->text_language; $tra_obra->idiomaid = $model->idiomaid; $tra_obra->save(); $this->redirect(array('view', 'id' => $model->idobra)); } } else { $model->text_language = $tra_obra->descripcion; $model->idiomaid = 2; //ingles } $this->render('update', array('model' => $model)); }