Example #1
0
 public function fileField($model, $attribute, $htmlOptions = array())
 {
     $controlOptions = BsArray::popValue('controlOptions', $htmlOptions, array());
     $labelOptions = BsArray::popValue('labelOptions', $htmlOptions, array());
     $layout = $this->layout;
     $output = '';
     $output .= CHtml::activeFileField($model, $attribute, $htmlOptions);
     $attr = $model->{$attribute};
     if (!empty($attr)) {
         //Special logic for ContentTypes
         $tmpModel = $model;
         if ($model instanceof ContentType) {
             $tmpModel = $model->Content;
         }
         $output .= '<p class="file">' . CHtml::link($model->{$attribute}, array('/site/getFile', 'id' => $tmpModel->id, 'field' => $attribute, 'modelName' => get_class($tmpModel))) . '</p>';
         $output .= '<div class="checkbox">' . CHtml::checkBox($attribute . '_delete');
         $output .= CHtml::label('Delete?', $attribute . '_delete') . '</div>';
     }
     $htmlOptions['input'] = $output;
     $htmlOptions['labelOptions'] = BsHtml::setLabelOptionsByLayout($layout, $labelOptions);
     if (!empty($layout)) {
         if ($layout === BsHtml::FORM_LAYOUT_HORIZONTAL) {
             $controlClass = BsArray::popValue('class', $controlOptions, BsHtml::$formLayoutHorizontalControlClass);
             BsHtml::addCssClass($controlClass, $htmlOptions['controlOptions']);
         }
     }
     return BsHTML::activeTextFieldControlGroup($model, $attribute, $htmlOptions);
 }
Example #2
0
 /**
  * Renders the input file field
  */
 public function renderField()
 {
     if ($this->hasModel()) {
         echo \CHtml::activeFileField($this->model, $this->attribute, $this->options);
     } else {
         echo \CHtml::fileField($this->options['name'], $this->value, $this->options);
     }
 }
Example #3
0
 /**
  * Generates the required HTML and Javascript
  */
 public function run()
 {
     //echo 'Chức năng upload file tạm thời Off để bảo trì, liên hệ trangptk@vega.com.vn';
     list($name, $id) = $this->resolveNameID();
     $model = $this->model;
     if (!isset($this->options['uploadTable'])) {
         $uploadTable = "files";
         $this->options['uploadTable'] = "#files";
     } else {
         $uploadTable = $this->options['uploadTable'];
         $this->options['uploadTable'] = "#{$uploadTable}";
     }
     if (!isset($this->options['downloadTable'])) {
         $downloadTable = "files";
         $this->options['downloadTable'] = "#files";
     } else {
         $downloadTable = $this->options['downloadTable'];
         $this->options['downloadTable'] = "#{$downloadTable}";
     }
     if (!isset($this->options['buildUploadRow'])) {
         $this->options['buildUploadRow'] = $this->_getBuildUploadRow();
     }
     if (!isset($this->options['buildDownloadRow'])) {
         $this->options['buildDownloadRow'] = $this->_getBuildDownloadRow();
     }
     if (!isset($this->htmlOptions['enctype'])) {
         $this->htmlOptions['enctype'] = 'multipart/form-data';
     }
     if (!isset($this->htmlOptions['class'])) {
         $this->htmlOptions['class'] = 'xupload-form file_upload';
     }
     if (!isset($this->htmlOptions['id'])) {
         $this->htmlOptions['id'] = get_class($model) . "_form";
     }
     $options = CJavaScript::encode($this->options);
     CVarDumper::dumpAsString($options, 10, true);
     Yii::app()->clientScript->registerScript(__CLASS__ . '#' . $this->htmlOptions['id'], "jQuery('#{$this->htmlOptions['id']}').fileUploadUI({$options});", CClientScript::POS_READY);
     //echo "<pre>";print_r($options);exit();
     echo CHtml::beginForm($this->url, 'post', $this->htmlOptions);
     $htmlOptions = array();
     if ($this->multiple) {
         $htmlOptions["multiple"] = true;
     }
     if ($this->hasModel()) {
         echo CHtml::activeFileField($this->model, $this->attribute, $htmlOptions);
     } else {
         echo CHtml::fileField($name, $this->value, $htmlOptions);
     }
     echo CHtml::tag("button", array(), "Upload", true);
     echo CHtml::tag("div", array(), $this->text, true);
     echo CHtml::endForm();
     if ($uploadTable == $downloadTable) {
         echo CHtml::tag("table", array("id" => $uploadTable), "", true);
     } else {
         echo CHtml::tag("table", array("id" => $uploadTable), "", true);
         echo CHtml::tag("table", array("id" => $downloadTable), "", true);
     }
 }
 /**
  * @param $value
  * @return string
  */
 public function editAttribute($model, $field, $params = array())
 {
     if (!isset($params['options'])) {
         $params['options'] = array();
     }
     $options = $params['options'];
     unset($params['options']);
     return CHtml::activeFileField($model, $field->varname, $params) . ($model->getAttribute($field->varname) ? '<br/>' . CHtml::activeCheckBox($model, '[uwfdel]' . $field->varname, $params) . ' ' . CHtml::activeLabelEx($model, '[uwfdel]' . $field->varname, array('label' => UserModule::t('Delete file'), 'style' => 'display:inline;')) : '');
 }
Example #5
0
    public function run()
    {
        $type = DataType::getInputType($this->column->dbType);
        $this->htmlOptions += $this->fixedHtmlOptions[$type];
        $column = $this->column->name;
        $name = isset($this->htmlOptions['name']) ? $this->htmlOptions['name'] : 'Row[' . $column . ']';
        switch ($type) {
            case 'number':
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                break;
            case 'select':
                echo CHtml::activeDropDownList($this->row, $column, $this->getEnumValues(), $this->htmlOptions);
                break;
            case 'select-multiple':
                #echo CHtml::activeListBox($this->row, $column, $this->getSetValues(), $this->htmlOptions);
                echo CHtml::listBox($name, $this->row->getAttributeAsArray($column), $this->getSetValues(), $this->htmlOptions);
                break;
            case 'text':
                echo CHtml::activeTextArea($this->row, $column, $this->htmlOptions);
                break;
            case 'file':
                echo '<script type="text/javascript">
					$(document).ready(function() {
						$("# echo CHtml::$idPrefix; ?>").submit(function() {
							alert("ok1");
							
						});
					});
					</script>';
                echo CHtml::activeFileField($this->row, $column, $this->htmlOptions);
                break;
            case 'date':
                $this->SetDateTimeHtmlOptions($column);
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                echo '<script type="text/javascript">
						$(document).ready(function() {
							$("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd", buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
						});
						</script>';
                break;
            case 'datetime':
                $this->SetDateTimeHtmlOptions($column);
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                echo '<script type="text/javascript">
						$(document).ready(function() {
							now = new Date();
							$("#' . $this->htmlOptions['id'] . '").datepicker({showOn: "button", dateFormat: "yy-mm-dd " + now.getHours() + ":" + now.getMinutes() + ":" + now.getSeconds(), buttonImage: "' . ICONPATH . '/16/calendar.png' . '", buttonImageOnly: true, buttonText: "' . Yii::t('core', 'showCalendar') . '"});
						});
						</script>';
                break;
            default:
                echo CHtml::activeTextField($this->row, $column, $this->htmlOptions);
                break;
        }
    }
Example #6
0
 /**
  * Renders the input file field
  */
 public function renderField()
 {
     list($name, $id) = $this->resolveNameID();
     $this->htmlOptions = WhHtml::defaultOption('id', $id, $this->htmlOptions);
     $this->htmlOptions = WhHtml::defaultOption('name', $name, $this->htmlOptions);
     $this->htmlOptions['data-url'] = $this->uploadAction;
     if ($this->hasModel()) {
         echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::fileField($name, $this->value, $this->htmlOptions);
     }
 }
Example #7
0
 public function run()
 {
     $val = $this->model->{$this->attribute};
     if (!$this->model->isNewRecord && $val) {
         $id = $this->id . get_class($this);
         $files_data = $this->model->uploadFiles();
         $attribute_data = $files_data[$this->attribute];
         $directory = trim($attribute_data['dir'], '/');
         $preview = ImageHelper::thumb($directory, $val, array('width' => null, 'height' => 128));
         $preview .= CHtml::ajaxLink('X', array('/main/helpAdmin/saveAttribute'), array('type' => 'post', 'data' => array('model' => get_class($this->model), 'id' => $this->model->primaryKey, 'attribute' => $this->attribute, 'value' => '', 'unlink_file' => $directory . '/' . $val), 'success' => 'js:function() {$("#' . $id . '").remove();}'), array('class' => 'btn btn-danger delete-img'));
         echo CHtml::tag('div', array('id' => $id), $preview);
     }
     echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
 }
Example #8
0
 /**
  * Runs the widget.
  */
 public function run()
 {
     $id = $this->id . '-file';
     $containerId = $this->id . '-container';
     $label = '选择文件';
     if ($this->hasModel()) {
         $name = CHtml::activeName($this->model, $this->attribute) . '[]';
         if ($this->form) {
             $label .= $this->form->fileField($this->model, $this->attribute, array('name' => $name, 'id' => $id, 'hideFocus' => true));
         } else {
             $label .= CHtml::activeFileField($this->model, $this->attribute, array('name' => $name, 'id' => $id, 'hideFocus' => true));
         }
     }
     $this->controller->widget('bootstrap.widgets.TbButton', array('label' => $label, 'size' => 'small', 'icon' => 'plus', 'encodeLabel' => false, 'htmlOptions' => $this->htmlOptions));
     echo CHtml::tag('div', array('id' => $containerId), '', true);
     Yii::app()->bootstrap->registerAssetCss('bootstrap-file-selector.css');
     $cs = Yii::app()->getClientScript();
     $cs->registerCoreScript('multifile');
     $cs->registerScript(__CLASS__ . '#' . $this->id, "\n\$('#{$id}').MultiFile(" . CJavaScript::encode($this->options) . ")");
 }
        <?php 
echo $form->error($model, 'student_transaction_shift_id');
?>
	</div>

    </div>

    <div class="row">
	      <?php 
echo $form->labelEx($photo, 'student_photos_path');
?>
	      <?php 
CHtml::form('', 'post', array('enctype' => 'multipart/form-data'));
?>
	      <?php 
echo CHtml::activeFileField($photo, 'student_photos_path', array('tabindex' => 15));
?>
<span class="status">&nbsp;</span>
		<?php 
if (isset($photo->student_photos_path)) {
    echo CHtml::image(Yii::app()->baseUrl . '/stud_images/' . $photo->student_photos_path, "", array("width" => "50px", "height" => "50px"));
}
?>
	
	      <?php 
CHtml::endForm();
?>
</div>

<div class="row buttons">
		<?php 
?>
    <h1>Import settings</h1>


    <?php 
echo CHtml::beginForm($this->createUrl('superadmin/exportadminssettings'), 'post', array('id' => 'formimportadminssettings', 'enctype' => 'multipart/form-data'));
?>
    <?php 
echo CHtml::hiddenField('type', 'import');
?>
    <table class="">
        <tr>
            <th><?php 
echo CHtml::activeLabel($importAdminsSettings, 'imported_file');
?>
:</th>
            <td><?php 
echo CHtml::activeFileField($importAdminsSettings, 'imported_file');
?>
</td>
        </tr>
    </table>
    <br/><br/>
    <?php 
echo CHtml::submitButton('Import');
?>
    <?php 
echo CHtml::endForm();
?>

</div>
Example #11
0
        <?php 
if ($model->isNewRecord) {
    ?>
<img src="/images/nophoto_100_100.jpg"><?php 
} else {
    //Проверяем файл, если нет картинки - ставим заглушку
    $url_img = "/images/nophoto_100_100.jpg";
    if (file_exists(YiiBase::getPathOfAlias('webroot') . $base_url_img . $model->id . '.' . $model->image)) {
        $url_img = $base_url_img . 'small-' . $model->id . '.' . $model->image;
    }
    echo '<a href="' . $base_url_img . $model->id . '.' . $model->image . '" target="_blank"><img src="' . $url_img . '"></a>';
}
?>
        <br>
        <?php 
echo CHtml::activeFileField($model, 'imagefile', array('style' => 'cursor: pointer;'));
?>
    </div>
</div>




<div class="block_url" style="width: 100%; background-color: #3689d8; margin-bottom: 5px; cursor: pointer;">
    <a href="#" data-type="plus"><span style="color: #fff; margin-left: 10px; font-weight: bold;"><img src="/images/admin/icons/plus.gif" style="padding-right: 10px;" />Настройки</span></a>
</div>
<div style="margin-top: 10px; padding: 10px; display: none;">
    <?php 
echo $form->dropDownListRow($model, 'primary', array('0' => 'Нет', '1' => 'Да'), array('class' => 'span5'));
?>
    <?php 
Example #12
0
if ($this->showForm) {
    echo CHtml::beginForm($this->url, 'post', $this->htmlOptions);
}
?>
<div class="row fileupload-buttonbar">
	<div class="span7">
		<!-- The fileinput-button span is used to style the file input field as button -->
		<span class="btn btn-success fileinput-button">
            <i class="icon-plus icon-white"></i>
            <span><?php 
echo $this->t('1#Agregar fotos|0#Choose file', $this->multiple);
?>
</span>
			<?php 
if ($this->hasModel()) {
    echo CHtml::activeFileField($this->model, $this->attribute, $htmlOptions) . "\n";
} else {
    echo CHtml::fileField($name, $this->value, $htmlOptions) . "\n";
}
?>
		</span>
        <?php 
if ($this->multiple) {
    ?>
		<button type="submit" class="btn btn-primary start">
			<i class="icon-upload icon-white"></i>
			<span>Subir</span>
		</button>
		<button type="reset" class="btn btn-warning cancel">
			<i class="icon-ban-circle icon-white"></i>
			<span>Cancelar</span>
<h2>Image Gallery</h2>
<div class="form">
<?php 
echo CHtml::beginForm('', 'post', array('enctype' => 'multipart/form-data'));
echo CHtml::errorSummary($model);
echo CHtml::activeFileField($model, 'image');
?>
<br>
<?php 
echo CHtml::submitButton('Upload', array('name' => 'submitPost'));
echo CHtml::endForm();
?>
</div><!-- form -->
<br>
<?php 
//$criteria=new CDbCriteria;
//$pages=new CPagination(count($filelist));
//$pages->pageSize=Yii::app()->params['imagesPerPage'];
//$pages->applyLimit($criteria);
$i = 0;
?>

<table class="dataGrid">
  <tr>
    <th><?php 
echo 'Thumbnail';
?>
</th>
    <th><?php 
echo 'File Name';
?>
Example #14
0
							<label>Yes</label>
						</div>						
					</div>
				</div>

				<div class="form-group">
					<label class="<?php 
echo $label_class;
?>
">Doctor Note</label>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::image($model->getLetter(), 'letter', array('height' => '50px'));
?>
						<?php 
echo CHtml::activeFileField($modelPhoto, 'file', array('class' => 'btn btn-success'));
?>
						<?php 
echo CHtml::error($model, 'doctor_letter_proof');
?>
					</div>					
				</div>

				<div class="form-group">
					<?php 
echo CHtml::activeLabelEx($model, 'number_of_hours', array('class' => $label_class));
?>
					<div class="col-md-6 col-xs-12">
						<?php 
echo CHtml::activeTextField($model, 'number_of_hours', array('class' => 'validate[required] form-control', 'style' => 'width:100px;', 'value' => ''));
?>
Example #15
0
$this->widget('zii.widgets.jui.CJuiDatePicker', array('model' => $model, 'attribute' => 't_lahir', 'value' => $model->t_lahir, 'options' => array('dateFormat' => 'yy-mm-dd', 'showOn' => 'button', 'yearRange' => '-60', 'changeMonth' => 'ture', 'changeYear' => 'true', 'constrainInput' => 'false', 'duration' => 'fast', 'showAnim' => 'slide'), 'htmlOptions' => array('size' => 20)));
?>
		<?php 
echo $form->error($model, 't_lahir');
?>
	</div>

	<div class="row">
                <?php 
echo $form->labelEx($model, 'foto');
?>
                <?php 
echo "Upload Your's image", "<br>";
?>
                <?php 
echo CHtml::activeFileField($model, 'foto');
?>
                <?php 
echo $form->error($model, 'foto');
?>
         </div>


	<div class="row">
		<?php 
echo $form->labelEx($model, 'gender');
?>
		<?php 
echo $form->dropDownList($model, 'gender', User::gender(), array('prompt' => '- Choose -', 'style' => 'width: 200px; '));
?>
		<?php 
Example #16
0
 /**
  * Echos or returns the file field, temp name hidden field, the delete checkbox and preview image and set up the uploadcare widget if used.
  * 
  * @param CActiveForm $form the form in which the widget is called. Can be null if CActiveForm is not used. Defaults to null in parent class.
  * 
  * @param boolean $return whether to return the html or just echo it. Defaults to false in parent class.
  * 
  * @param string $attributePostName the fields name if non standard. Such as if using array notation. The format is [key1][key2][keyn...]attributeName, no class name. Defaults to null in parent class.
  * 
  * @param array $fileFieldHtmlOptions html options for file field. Defaults to empty array in parent class.
  * 
  * @param array $checkboxHtmlOptions html options for checkbox field. Defaults to empty array in parent class.
  * 
  * @param array $previewImageHtmlOptions html options for preview image. Defaults to empty array in parent class.
  * 
  * @return string the html.
  */
 public function makeField($form, $attributePostName, $fileFieldHtmlOptions, $checkboxHtmlOptions, $previewImageHtmlOptions)
 {
     $behavior = $this->_behavior;
     $owner = $behavior->owner;
     $attribute = $behavior->attribute;
     $ownerClass = get_class($owner);
     $html = '';
     if (isset($attributePostName)) {
         $postAttributeArrays = substr($attributePostName, 0, strrpos($attributePostName, ']') + 1);
     } else {
         $postAttributeArrays = '';
     }
     foreach ($owner->behaviors() as $ownerBehaviorName => $ownerBehaviorParams) {
         if (($ownerBehaviorParams['class'] == 'application.components.behaviors.UploadingBehavior.ActiveRecordUploadingBehavior' || $ownerBehaviorParams['class'] == 'application.components.behaviors.UploadingBehavior.ModelUploadingBehavior') && $ownerBehaviorParams['attribute'] == $behavior->attribute) {
             $behaviorName = $ownerBehaviorName;
             break;
         }
     }
     $html .= '<div class="uploadFieldWrap">';
     if ($owner->{$attribute} != '') {
         if ($behavior->showPreviewImage) {
             $html .= CHtml::image(Yii::app()->request->baseUrl . '/' . ($owner->{$behaviorName}->tempName != '' ? $owner->{$behaviorName}->tempDir . '/' . $this->fileSuffix($owner->{$behaviorName}->tempName, $behavior->previewImageSuffix) : $owner->{$behaviorName}->dir . '/' . $this->fileSuffix($owner->{$attribute}, $behavior->previewImageSuffix)), '', $previewImageHtmlOptions);
         }
         if ($behavior->allowDelete) {
             $html .= CHtml::checkbox($ownerClass . $postAttributeArrays . '[' . $behaviorName . '][delete]', $behavior->delete, $checkboxHtmlOptions) . '<span>' . Yii::t('admin', 'Supprimer ou') . '&nbsp;&nbsp;</span>';
         }
         $html .= CHtml::hiddenField($ownerClass . $postAttributeArrays . '[' . $behaviorName . '][tempName]', $behavior->tempName);
     }
     if ($behavior->uploadcare !== null) {
         Yii::app()->clientScript->registerScript('UploadingBehaviorUploadCarePublicKey', "UPLOADCARE_PUBLIC_KEY = '" . $this->_uploadcareApi->getPublicKey() . "'; UPLOADCARE_LOCALE = '" . (isset($behavior->uploadcare['language']) ? $behavior->uploadcare['language'] : Yii::app()->language) . "';", CClientScript::POS_HEAD);
         Yii::app()->clientScript->registerScriptFile($this->_uploadcareApi->widget->getScriptSrc(), CClientScript::POS_HEAD);
         $options = array('role' => 'uploadcare-uploader');
         $uploadcareArr = $behavior->uploadcare;
         unset($uploadcareArr['publicKey']);
         unset($uploadcareArr['privateKey']);
         unset($uploadcareArr['language']);
         $options = array_merge($options, $uploadcareArr);
         if (!isset($options['data-images-only']) && isset($behavior->formats)) {
             $options['data-images-only'] = 'true';
         }
         if (!isset($options['data-crop']) && isset($behavior->formats)) {
             $options['data-crop'] = 'true';
         }
         $html .= CHtml::hiddenField($ownerClass . $postAttributeArrays . '[' . $attribute . ']', '', $options);
     } else {
         if ($form !== null) {
             $html .= $form->fileField($owner, $postAttributeArrays . $attribute, $fileFieldHtmlOptions);
         } else {
             $html .= CHtml::activeFileField($owner, $postAttributeArrays . $attribute, $fileFieldHtmlOptions);
         }
     }
     $html .= '</div>';
     return $html;
 }
Example #17
0
        <?php 
if ($model->isNewRecord) {
    ?>
<img src="/images/nophoto_100_100.jpg"><?php 
} else {
    //Проверяем файл, если нет картинки - ставим заглушку
    $url_img = "/images/nophoto_100_100.jpg";
    if (file_exists(YiiBase::getPathOfAlias('webroot') . $base_url_img . 'after_' . $model->id . '.' . $model->after_photo)) {
        $url_img = $base_url_img . 'small-after_' . $model->id . '.' . $model->after_photo;
    }
    echo '<a href="' . $base_url_img . 'after_' . $model->id . '.' . $model->after_photo . '" target="_blank"><img src="' . $url_img . '"></a>';
}
?>
        <br>
        <?php 
echo CHtml::activeFileField($model, 'after_photo_file', array('style' => 'cursor: pointer;'));
?>
    </div>
</div>

<?php 
Yii::import('ext.imperavi-redactor-widget-master.ImperaviRedactorWidget');
echo $form->labelEx($model, 'briftext');
$this->widget('ImperaviRedactorWidget', array('model' => $model, 'attribute' => 'briftext', 'options' => array('lang' => 'ru', 'cleanOnPaste' => false, 'cleanStyleOnEnter' => true, 'cleanSpaces' => false, 'replaceDivs' => false, 'imageUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/imageUpload'), 'fileUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/fileUpload'), 'imageManagerJson' => Yii::app()->createAbsoluteUrl('/pages/pages/getImageLibray')), 'plugins' => array('fullscreen' => array('js' => array('fullscreen.js')), 'video' => array('js' => array('video.js')), 'table' => array('js' => array('table.js')), 'fontcolor' => array('js' => array('fontcolor.js')), 'fontfamily' => array('js' => array('fontfamily.js')), 'fontsize' => array('js' => array('fontsize.js')), 'filemanager' => array('js' => array('filemanager.js')), 'myphotogalery' => array('js' => array('myphotogalery.js')), 'imagemanager' => array('js' => array('imagemanager.js')))));
echo $form->labelEx($model, 'before_text');
$this->widget('ImperaviRedactorWidget', array('model' => $model, 'attribute' => 'before_text', 'options' => array('lang' => 'ru', 'cleanOnPaste' => false, 'cleanStyleOnEnter' => true, 'cleanSpaces' => false, 'replaceDivs' => false, 'imageUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/imageUpload'), 'fileUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/fileUpload'), 'imageManagerJson' => Yii::app()->createAbsoluteUrl('/pages/pages/getImageLibray')), 'plugins' => array('fullscreen' => array('js' => array('fullscreen.js')), 'video' => array('js' => array('video.js')), 'table' => array('js' => array('table.js')), 'fontcolor' => array('js' => array('fontcolor.js')), 'fontfamily' => array('js' => array('fontfamily.js')), 'fontsize' => array('js' => array('fontsize.js')), 'filemanager' => array('js' => array('filemanager.js')), 'myphotogalery' => array('js' => array('myphotogalery.js')), 'imagemanager' => array('js' => array('imagemanager.js')))));
echo $form->labelEx($model, 'after_text');
$this->widget('ImperaviRedactorWidget', array('model' => $model, 'attribute' => 'after_text', 'options' => array('lang' => 'ru', 'cleanOnPaste' => false, 'cleanStyleOnEnter' => true, 'cleanSpaces' => false, 'replaceDivs' => false, 'imageUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/imageUpload'), 'fileUpload' => Yii::app()->createAbsoluteUrl('/pages/pages/fileUpload'), 'imageManagerJson' => Yii::app()->createAbsoluteUrl('/pages/pages/getImageLibray')), 'plugins' => array('fullscreen' => array('js' => array('fullscreen.js')), 'video' => array('js' => array('video.js')), 'table' => array('js' => array('table.js')), 'fontcolor' => array('js' => array('fontcolor.js')), 'fontfamily' => array('js' => array('fontfamily.js')), 'fontsize' => array('js' => array('fontsize.js')), 'filemanager' => array('js' => array('filemanager.js')), 'myphotogalery' => array('js' => array('myphotogalery.js')), 'imagemanager' => array('js' => array('imagemanager.js')))));
?>

<?php 
Example #18
0
 function run()
 {
     $this->defineNameId();
     $this->setBaseOptions();
     if ($this->hasModel()) {
         echo CHtml::activeFileField($this->model, $this->attribute, $this->htmlOptions);
     } else {
         echo CHtml::fileField($this->_name, $this->value, $this->htmlOptions);
     }
     if ($this->uploadButton === true || $this->uploadButton === null && (!isset($this->_options['auto']) || $this->_options['auto'] == false)) {
         echo $this->createUploadButton();
     }
     Yii::app()->getClientScript()->registerScript(get_class($this) . '-' . $this->getInputId(), "\$('#{$this->inputId}').uploadify(" . CJavaScript::encode($this->_options) . ");", CClientScript::POS_END);
 }
Example #19
0
//  No_photo
echo $this->post_image($model->id, substr($model->create_time, 0, 4), $model->title, $model->image, '200', 'small_img left');
?>
		<br clear="all">
		<?php 
//
/*if(isset($model->image) && file_exists(Yii::getPathOfAlias('webroot').'/images/uploads/'.$model->image))
		{
			echo $form->checkBox($model,'del_img');
			echo $form->labelEx($model,'del_img');
		}*/
?>
		<br />
		<?php 
//
echo CHtml::activeFileField($model, 'icon');
?>
	</div>

	<div class="row buttons">

		<?php 
echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save');
?>
	</div>

<?php 
$this->endWidget();
?>

</div><!-- form -->
Example #20
0

<div class="row-fluid">
	<div class="span5">
		<?php 
$form = $this->beginWidget('AdminForm', array('id' => 'Media_med_epc', 'htmlOptions' => ['enctype' => 'multipart/form-data']));
?>
		<h4>EPC</h4>

		<div class="epc-upload-container">
			<div class="control-group">
				<label class="control-label">EPC File</label>

				<div class="controls">
					<?php 
echo CHtml::activeFileField($model, 'epc', ['id' => 'media']);
?>
				</div>
			</div>
			<div class="block-buttons force-margin"><?php 
echo CHtml::submitButton('Upload EPC', ['name' => 'epcUpload', 'class' => 'btn']);
?>
</div>
		</div>
		<?php 
$this->endWidget();
?>
	</div>

	<div class="span7">
		<div class="media-files sortable" id="EPC">
        echo Yum::t('Your Avatar image');
        echo '</h2>';
        echo $model->getAvatar();
    } else {
        echo Yum::t('You do not have set an avatar image yet');
    }
}
echo '<br />';
if (Yum::module('avatar')->avatarMaxWidth != 0) {
    echo '<p>' . Yum::t('The image should have at least 50px and a maximum of 200px in width and height. Supported filetypes are .jpg, .gif and .png') . '</p>';
}
echo CHtml::errorSummary($model);
echo CHtml::beginForm(array('//avatar/avatar/editAvatar', 'id' => $model->id), 'POST', array('enctype' => 'multipart/form-data'));
echo '<div class="row">';
echo CHtml::activeLabelEx($model, 'avatar');
echo CHtml::activeFileField($model, 'avatar');
echo CHtml::error($model, 'avatar');
echo '</div>';
if (Yum::module('avatar')->enableGravatar) {
    echo CHtml::submitButton(Yum::t('Upload avatar'), array('class' => 'btn btn-primary left_button'));
}
echo '<br />';
echo CHtml::link(Yum::t('Use Gravatar'), array('//avatar/avatar/enableGravatar', 'id' => $model->id), array('class' => 'btn btn-primary left_button'));
echo '&nbsp;';
echo CHtml::link(Yum::t('Remove Avatar'), array('//avatar/avatar/removeAvatar', 'id' => $model->id), array('class' => 'btn btn-primary left_button'));
echo CHtml::endForm();
?>

                                       </div>
                    </div>
               
Example #22
0
				</td>
				<td>
					<?php 
    echo CHtml::activeTextField($files, 'name', !Yii::app()->user->isGuest ? array('value' => Yii::app()->user->name, 'readonly' => 'readonly') : '');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo CHtml::activeLabel($files, 'demo_real');
    ?>
				</td>
				<td>
					<?php 
    echo CHtml::activeFileField($files, 'demo_real');
    ?>
				</td>
			</tr>
			<tr>
				<td>
					<?php 
    echo CHtml::activeLabel($files, 'comment');
    ?>
				</td>
				<td>
					<?php 
    echo CHtml::activeTextArea($files, 'comment');
    ?>
				</td>
			</tr>
Example #23
0
    }
}
?>
	
				</select>
			</td>
		</tr> -->

		<tr>
			<th><?php 
echo CHtml::activeLabel($product, 'image_path');
?>
</th>
			<td>
				<?php 
echo CHtml::activeFileField($product, 'productFile');
?>
 
				<?php 
if ($product->image_path) {
    ?>
				<br />
				<?php 
    if (FileHelper::getExtension($product->image_path) == 'swf') {
        ?>
				<?php 
        echo CHtml::link($product->getProductFileUrl(), $product->getProductFileUrl(), array('target' => '_blank'));
        ?>
				<?php 
    } else {
        ?>
Example #24
0
echo $form->textField($model, 'status_titulo', array('size' => 60, 'maxlength' => 100));
?>
	<?php 
echo $form->error($model, 'status_titulo');
?>
	</div>

	<div class="row">
	<?php 
/*$this->widget('CMultiFileUpload', array(
                'name' => 'CmsBanner[cms_banner_path]',
                'accept' => 'jpeg|jpg|gif|png', // useful for verifying files
                'duplicate' => 'Arquivo duplicado!', // useful, i think
                'denied' => 'Tipo de arquivo inválido', // useful, i think
	));*/
echo CHtml::activeFileField($model, 'status_path');
?>
		 <img src="<?php 
echo "http://" . $_SERVER["HTTP_HOST"] . Yii::app()->baseUrl . "/uploads/" . Yii::app()->params['uploadPathStatus'] . $model->status_id . "/" . $model->status_path;
?>
">
	</div>
	
	<div class="row">
	<?php 
echo $form->labelEx($model, 'status_excluido');
?>
	<?php 
echo $form->dropDownList($model, 'status_excluido', array('S' => 'Sim', 'N' => 'Não'));
?>
	<?php 
Example #25
0
 /**
  * Generates a file field input for a model attribute.
  * @param CModel $model the data model.
  * @param string $attribute the attribute.
  * @param array $htmlOptions additional HTML attributes.
  * @return string the generated input field.
  * @see CHtml::activeFileField
  */
 public static function activeFileField($model, $attribute, $htmlOptions = array())
 {
     return parent::activeFileField($model, $attribute, $htmlOptions);
 }
Example #26
0
										<td colspan="4" align="left" valign="middle"><strong>Please
										print and sign sections #5 and #16 of the <a href="<?php 
    echo Yii::app()->request->baseUrl;
    ?>
/forms/ps1583.pdf">[Postal
										Service Form 1583]</a></strong></td>
									</tr>
									<tr class="thirdId">
										<td align="left" valign="middle">&nbsp;</td>
										<td align="left" valign="middle">&nbsp;</td>
										<td colspan="4" align="left" valign="middle">
<!--										<input-->
<!--											fileuploader="true" name="destIdPicture3" ftype="file"-->
<!--											disabled="disabled" id="destIdPicture3" value="" type="file" />-->
											<?php 
    echo CHtml::activeFileField($commande_model, 'dest_idpsform3');
    ?>
										</td>
									</tr>
                                    
									<?php 
}
?>
									<tr class="thirdId">
										<td height="20" colspan="6" align="left" valign="middle">&nbsp;</td>
									</tr>
                                    
                                    <?php 
if ($onetime == false) {
    ?>
                                    
Example #27
0
 /**
  * Renders a file field for a model attribute.
  * This method is a wrapper of {@link CHtml::activeFileField}.
  * Please check {@link CHtml::activeFileField} for detailed information
  * about the parameters for this method.
  * @param CModel $model the data model
  * @param string $attribute the attribute
  * @param array $htmlOptions additional HTML attributes
  * @return string the generated input field
  */
 public function fileField($model, $attribute, $htmlOptions = array())
 {
     return CHtml::activeFileField($model, $attribute, $htmlOptions);
 }
Example #28
0
?>
				<div class="modal fade" id="myModal3" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
                  <div class="modal-dialog">
                    <div class="modal-content">
                      <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
                        <h4 class="modal-title" id="myModalLabel">Import Data Mahasiswa </h4>
                      </div>
                      <div class="modal-body">
        						  <?php 
echo CHtml::form('', 'post', array('enctype' => 'multipart/form-data', 'role' => 'form'));
?>
        							  <div class="row">
        								<label for="exampleInputFile">File input</label>
        								<?php 
echo CHtml::activeFileField($upload, 'file');
?>
        								<p class="help-block">tipe file sql.</p>
        							  </div>
        							  <button type="submit" class="btn btn-default">Submit</button>
        							<?php 
echo CHtml::endForm();
?>
                      </div>
                      <div class="modal-footer">
                        <a type="button" class="btn btn-default" data-dismiss="modal">Close</a>
                      </div>
                    </div><!-- /.modal-content -->
                  </div><!-- /.modal-dialog -->
                </div><!-- /.modal -->
           <div class="modal fade" id="data-mahasiswa" tabindex="-1" role="dialog" aria-labelledby="myModalLabel2" aria-hidden="true">
Example #29
0
    <td><?php 
echo $form->textField($model, 'keywords', array('size' => 50, 'maxlength' => 50, 'class' => 'text'));
?>
</td>
  </tr>
    <tr>
    <th>描述:</th>
    <td><?php 
echo $form->textArea($model, 'description', array('class' => 'textarea'));
?>
 </td>
  </tr>
  <tr>
    <th>缩略图:</th>
    <td><?php 
echo CHtml::activeFileField($model, 'imgurl');
?>
<p>
    <a href="#">显示缩略图</a>
    </p>
    
    
    </td>
  </tr>
   <tr>
    <th>文章内容:</th>
    <td><?php 
$this->widget('ext.wdueditor.WDueditor', array('model' => $model, 'attribute' => 'content', 'language' => 'zh-cn', 'width' => '100%', 'height' => '600'));
?>
</td>
 
Example #30
0
echo $form->textField($user_model, 'email', array('class' => 'basic-input', 'placeholder' => '例如:yy@qukaiyuan.com', 'maxlength' => 50));
?>
						<span class="error-tip" style="display: inline; ">
							<?php 
echo $form->error($user_model, 'email');
?>
</span>
						</div>

						<div class="item"><div class="wenzi">
							<?php 
echo $form->labelEx($user_model, 'photo');
?>
</div>
							<?php 
echo CHtml::activeFileField($user_model, 'photo');
?>
						<span class="error-tip" style="display: inline; "></span>
						</div>

						

						<div class="item"><div class="wenzi">
							<?php 
echo $form->labelEx($user_model, 'verifyCode');
?>
</div>
							<?php 
$this->widget('CCaptcha', array('showRefreshButton' => false, 'clickableImage' => true, 'imageOptions' => array('alt' => '点击换图', 'title' => '看不清楚?点击获取新的验证码', 'style' => 'cursor:pointer')));
?>
							<?php