<section class="expFacts ex-2 parallax" data-stellar-background-ratio="0.5" style="background-image: url('/img/exposition-<?php echo $model->id; ?> .jpg');"> <div class="exp-facts-slider"> <div class="container"> <div class="row"> <div id="exp-facts-btn" class="col-xs-8 col-xs-offset-2 text-center"> <img id="goToNextSlide" class="img-responsive" src="/img/btn-facts.png" onmouseover="this.src='/img/btn-facts_active.png'" onmouseout="this.src='/img/btn-facts.png'" /> </div> </div> <ul id="exp-facts-slider"> <?php $facts = Facts::model()->active()->findAll(); if ($facts) { foreach ($facts as $fact) { $src = $fact->getOrigFilePath() . $fact->image; ?> <li> <div class="row"> <div class="col-xs-12 col-sm-10 col-sm-offset-1 text-center"> <div class="exp-facts-fact"> <div class="row"> <div class="col-xs-12 col-sm-3 "> <img class="img-responsive" src="<?php echo $src; ?> " /> </div>
<div class="col-sm-10"> <?php echo $form->textArea($model, 'text', array('class' => 'form-control', 'placeholder' => 'Текст')); ?> <?php echo $form->error($model, 'text'); ?> </div> </div> <div class="form-group"> <?php echo $form->labelEx($model, 'status', array('class' => 'col-sm-2 control-label')); ?> <div class="col-sm-10"> <?php echo $form->dropDownList($model, 'status', Facts::getStatusNames(), array('encode' => false, 'class' => 'form-control', 'options' => array(Facts::STATUS_ACTIVE => array('selected' => 'selected')))); ?> </div> </div> <div class="form-group"> <?php CHtml::$afterRequiredLabel = ' <span class="text-danger">*</span>'; ?> <?php echo $form->labelEx($model, 'image', array('class' => 'col-sm-2 control-label')); ?> <div class="col-sm-10"> <?php $this->widget('ext.dropzone.EDropzone', array('id' => 'part' . $model->id, 'model' => $model, 'name' => 'image', 'attribute' => 'image', 'formId' => 'facts-form', 'sizeLimit' => $sizeLimit, 'deleteFile' => Yii::app()->createAbsoluteUrl('/admin/facts/deletefile'), 'unlinkFile' => Yii::app()->createAbsoluteUrl('/file/upload/unlink', array('uploadsession' => $this->uploadsession)), 'url' => $this->createAbsoluteUrl('/file/upload/upload', array('inputName' => 'image', 'uploadsession' => $this->uploadsession)), 'options' => array())); ?>
/** * Returns the data model based on the primary key given in the GET variable. * If the data model is not found, an HTTP exception will be raised. * @param integer $id the ID of the model to be loaded * @return Zal the loaded model * @throws CHttpException */ public function loadModel($id) { $model = Facts::model()->findByPk($id); if ($model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } return $model; }