Example #1
0
			<?php 
if (!Yii::app()->user->userModel->relProfile->use_multi_upload) {
    $this->widget('CMultiFileUpload', array('accept' => 'gif|jpg|jpeg|png|pdf|txt', 'model' => $answer, 'attribute' => 'uppload_files', 'htmlOptions' => array('class' => 'mf'), 'denied' => Yii::t('mf', 'Невозможно загрузить этот файл'), 'duplicate' => Yii::t('mf', 'Файл уже существует'), 'remove' => Yii::t('mf', 'удалить'), 'selected' => Yii::t('mf', 'Файлы: $file')));
} else {
    $this->widget('ext.EAjaxUpload.EAjaxUpload', array('id' => 'uploadFile', 'config' => array('action' => Yii::app()->createUrl('/holes/upload'), 'allowedExtensions' => array("jpg", "jpeg", "png", "gif", "txt", "pdf"), 'sizeLimit' => 10 * 1024 * 1024, 'minSizeLimit' => 20, 'multiple' => true, 'messages' => array('typeError' => "{file} не верный тип файла. Можно загружать только {extensions}.", 'sizeError' => "{file} слишком большой файл. Максимальный размер {sizeLimit}.", 'minSizeError' => "{file} слишком маленький файл. Минимальный размер {minSizeLimit}.", 'emptyError' => "{file} пуст. Выберите другой файл для загрузки", 'onLeave' => "Файлы загружаются, если вы выйдете сейчас, загрузка будет прервана."))));
}
?>
		</div>
		
		<!-- анкета -->
		<div class="f chekboxes">
			<?php 
echo $form->labelEx($answer, 'results');
?>
			<?php 
echo $form->checkBoxList($answer, 'results', CHtml::listData(HoleAnswerResults::model()->findAll(array('order' => 'ordering', 'condition' => 'published=1')), 'id', 'name'), array('attributeitem' => 'id', 'template' => '{input}{label}'));
?>
			<?php 
echo $form->error($answer, 'results');
?>
		</div>
		
	</div>
	<!-- /левая колоночка -->
	
	<!-- правая колоночка -->
	<div class="rCol"> 
	<div class="f">		
		<div class="bx-yandex-view-layout">
			<div class="bx-yandex-view-map">
			<div id="ymapcontainer" class="ymapcontainer"></div>
 /**
  * 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 the ID of the model to be loaded
  */
 public function loadModel($id)
 {
     $model = HoleAnswerResults::model()->findByPk((int) $id);
     if ($model === null) {
         throw new CHttpException(404, 'The requested page does not exist.');
     }
     return $model;
 }