public function processPosts() { //only for admins if ($this->levelAccess === 2) { if (isset($_POST['setStandardShop'])) { return shop::setStandardShop(); } if (isset($_POST['loadDefaultConfig'])) { return FBAdmin::loadDefaultConfig(); } if (isset($_POST['Cfg'])) { return FBAdmin::updateGalleryConfig(); } } //for users with access if ($this->levelAccess) { if (isset($_POST['function'])) { return self::switchToFunction(); } if (isset($_SERVER["HTTP_CONTENT_TYPE"]) || isset($_SERVER["CONTENT_TYPE"])) { return Uploader::uploadFiles(); } } }
<?php echo $form->dropDownList($model, 'thTitleShow', array(false => $this->tr('hideTitle'), true => $this->tr('showTitle'))); ?> <?php echo FBAdmin::getDefaultValue('album', 'thTitleShow'); ?> </div> <div class="row"> <?php echo FBAdmin::helpTooltip('useInfoBox'); ?> <?php echo $form->labelEx($model, 'useInfoBox'); ?> <?php echo $form->dropDownList($model, 'useInfoBox', array(false => $this->tr('hideInfo'), true => $this->tr('showInfo'))); ?> <?php echo FBAdmin::getDefaultValue('album', 'useInfoBox'); ?> </div> </div> <div class="rowForButtons"><?php echo CHtml::ajaxSubmitButton($this->tr('saveAlbum'), '', array('complete' => 'function(){$(".working").remove();}'), array('class' => 'fbCPButton')); ?> </div> <?php $this->endWidget();
?> </div> <div class="row"> <?php echo FBAdmin::helpTooltip('speedOut'); ?> <?php echo $form->labelEx($model, 'speedOut'); ?> <?php $this->widget('zii.widgets.jui.CJuiSlider', array('id' => 'speedOutSlider', 'value' => $model->speedOut, 'options' => array('min' => 10, 'max' => 900, 'step' => 50, 'slide' => 'js:function(event, ui) { $("#Cfg_speedOut").val(ui.value); }'), 'htmlOptions' => array('style' => 'height:12px;width:140px;margin-top:4px;float:left; margin-right:12px;'))); ?> <?php echo $form->textField($model, 'speedOut', array('class' => 'valSlider', 'readonly' => 'readonly')); ?> <?php echo FBAdmin::getDefaultValue('fancybox', 'speedOut'); ?> </div> </div> <div class="rowForButtons"><?php echo CHtml::ajaxSubmitButton($this->tr('saveFancyBox'), '', array('complete' => 'function(){$(".working").remove();}'), array('class' => 'fbCPButton')); ?> </div> <?php $this->endWidget();
?> <?php echo $form->dropDownList($model, 'unique_names', array(false => $this->tr('no'), true => $this->tr('yes'))); ?> <?php echo FBAdmin::getDefaultValue('uploader', 'unique_names'); ?> </div> <div class="row"> <?php echo FBAdmin::helpTooltip('runtimes'); ?> <?php echo $form->labelEx($model, 'runtimes'); ?> <?php echo $form->dropDownList($model, 'runtimes', array('gears' => 'gears', 'html4' => 'html4', 'html5' => 'html5', 'flash' => 'flash', 'silverlight' => 'silverlight', 'browserplus' => 'browserplus', 'html5, flash' => 'html5, flash', 'html5, flash, html4' => 'html5, flash, html4', 'gears,html5' => 'gears,html5', 'gears,html5,flash' => 'gears,html5,flash', 'gears,html5,flash,silverlight' => 'gears,html5,flash,silverlight', 'gears,html5,flash,silverlight,browserplus' => 'gears,html5,flash,silverlight,browserplus')); ?> <?php echo FBAdmin::getDefaultValue('uploader', 'runtimes'); ?> </div> </div> <div class="rowForButtons"><?php echo CHtml::ajaxSubmitButton($this->tr('saveUploader'), '', array('complete' => 'function(){$(".working").remove();}'), array('class' => 'fbCPButton')); ?> </div> <?php $this->endWidget();
<?php echo $form->textField($model, 'defaultLanguage'); ?> <?php echo FBAdmin::getDefaultValue('gallery', 'defaultLanguage'); ?> </div> <div class="row"> <?php echo FBAdmin::helpTooltip('languages'); ?> <?php echo $form->labelEx($model, 'languages'); ?> <?php echo $form->textField($model, 'languages'); ?> <?php echo FBAdmin::getDefaultValue('gallery', 'languages'); ?> </div> </div> <div class="rowForButtons"><?php echo CHtml::ajaxSubmitButton($this->tr('saveGallery'), '', array('complete' => 'function(){$(".working").remove();}'), array('class' => 'fbCPButton')); ?> </div> <?php $this->endWidget();
?> <?php echo $form->dropDownList($model, 'showCoverDescription', array(false => $this->tr('no'), true => $this->tr('yes'))); ?> <?php echo FBAdmin::getDefaultValue('collection', 'showCoverDescription'); ?> </div> <div class="row"> <?php echo FBAdmin::helpTooltip('showCoverTags'); ?> <?php echo $form->labelEx($model, 'showCoverTags'); ?> <?php echo $form->dropDownList($model, 'showCoverTags', array(false => $this->tr('no'), true => $this->tr('yes'))); ?> <?php echo FBAdmin::getDefaultValue('collection', 'showCoverTags'); ?> </div> </div> <div class="rowForButtons"><?php echo CHtml::ajaxSubmitButton($this->tr('saveCollection'), '', array('complete' => 'function(){$(".working").remove();}'), array('class' => 'fbCPButton')); ?> </div> <?php $this->endWidget();
/** * Sets @var $this->arrFiles with existing pictures * Render according to userType */ private function renderer() { //$this->arrFiles(); //$this->render('view'); //$this->render('uploader', array('max'=>Uploader::maxLenghtUploader())); $images = FImage::model()->findAll(array('order' => 'votes DESC')); //$order = $this->imgsOrder; $rel = preg_replace('!\\-+!', '-', preg_replace("/[^a-z0-9-_.]/", "-", strtolower($this->pageTitle))); $text_field = ' text_field'; $thTitleShow = true; $deleteIcon = ''; if ($this->userType === 'admin') { $deleteIcon = '<img src="' . $this->assetUrl . 'delete16x16.png" alt="X" />'; } $thUrl = $this->gUrl . '/' . $this->galleryConfig['thumbsDir'] . '/'; $imgsUrl = $this->gUrl . '/' . $this->galleryConfig['picturesDir'] . '/'; if (Yii::app()->user->isGuest) { $text_field = ''; $thTitleShow = $this->galleryConfig['thTitleShow']; $deleteIcon = ''; } foreach ($images as $img) { $this->item = array('id' => $img->id, 'votes' => $img->votes, 'fbid' => $img->fbid, 'thTitleShow' => $thTitleShow, 'title' => $img->caption, 'text_field' => $text_field, 'deleteIcon' => $deleteIcon, 'rel' => $rel, 'urlImg' => $imgsUrl . $img->name, 'imgSrc' => $thUrl . $img->name, 'fileName' => $img->name); $this->arrItems[$img->name] = $this->render('_item', array(), true); } if ($this->userType === 'visitor') { if ($this->pageName == "gallery") { $this->render('view'); } } if ($this->userType === 'editor' || $this->userType === 'admin') { if ($this->pageName == "gallery") { $this->render('viewEditor'); } if ($this->pageName == "newfoto") { $this->render('uploader', array('max' => Uploader::maxLenghtUploader())); } //$this->renderEditor(); } if ($this->userType === 'admin') { FBAdmin::cpanel(); } }
private function publishAssets() { $this->publishForVisitor(); if ($this->levelAccess) { $this->publishForLevel(); } if ($this->levelAccess === 2) { FBAdmin::publishAdmin(); } }