Esempio n. 1
0
 public function actionRss()
 {
     // disabling web log
     foreach (Yii::app()->log->routes as $route) {
         if ($route instanceof CWebLogRoute) {
             $route->enabled = false;
         }
     }
     Yii::import('ext.feed.*');
     $feed = new EFeed();
     $feed->title = Yii::app()->name . ' | ' . Yii::t('newsModule.common', 'Nouvelles');
     $feed->description = Yii::app()->name . ' | ' . Yii::t('newsModule.common', 'Nouvelles');
     $feed->addChannelTag('language', Yii::app()->language);
     $feed->addChannelTag('pubDate', date(DATE_RSS, time()));
     $feed->addChannelTag('link', $this->createAbsoluteUrl('index'));
     if ($news = News::model()->findAll(array('order' => 'date DESC', 'limit' => 25, 'condition' => "date <= '" . date('Y-m-d H:i:s') . "' AND section_id = " . Yii::app()->cms->currentSectionId))) {
         foreach ($news as $new) {
             $item = $feed->createNewItem();
             $item->title = $new->title;
             $item->link = $this->createAbsoluteUrl('detail', array('n' => $new->title_url));
             $item->date = $new->date;
             if (!empty($new->image)) {
                 $item->description = '<div style="margin-bottom: 1em;"><img src="' . Yii::app()->request->hostInfo . Yii::app()->request->baseUrl . '/' . $new->imageHandler->dir . '/' . Helper::encodeFileName(Helper::fileSuffix($new->image, 's')) . '" alt="' . CHtml::encode($new->title) . '" /></div><div>' . CHtml::encode($new->summary) . '</div>';
             } else {
                 $item->description = CHtml::encode($new->summary);
             }
             $feed->addItem($item);
         }
     }
     $feed->generateFeed();
     Yii::app()->end();
 }
Esempio n. 2
0
} else {
    ?>
	
	<div class="row">
		<?php 
    foreach ($categories as $category) {
        $categoryTitle = CHtml::encode($category->name);
        ?>
		
			<div class="categorie-produit col-sm-6 col-md-4 col-lg-3">
				<a href="<?php 
        echo $this->createUrl('listing', array('c' => $category->name_url));
        ?>
"></a>
				<img src="<?php 
        echo Yii::app()->request->baseUrl . "/" . $category->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($category->image, 'm'));
        ?>
" alt="<?php 
        echo $categoryTitle;
        ?>
" class="img-responsive" />
				<span class="wrapper-nom-produit"><?php 
        echo $categoryTitle;
        ?>
</span>
			</div>
			
			<?php 
    }
    ?>
	</div>
Esempio n. 3
0
?>
			
			<?php 
if ($bloc->comment != "") {
    ?>
			<dd class="note"><?php 
    echo CHtml::encode($bloc->comment);
    ?>
</dd>
			<?php 
}
?>
			
			<?php 
if ($bloc->image != "") {
    $image = '/' . $bloc->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($bloc->image, 'm'));
    $xtraClass = ($bloc->google_maps == "" and !$bloc->display_contact_form) ? " floated" : "";
    $imageTitle = CHtml::encode($bloc->image_title);
    ?>
			<dd class="picture<?php 
    echo $xtraClass;
    ?>
">
				<img class="photo img-responsive" src="<?php 
    echo Yii::app()->baseUrl . $image;
    ?>
" alt="<?php 
    echo $imageTitle;
    ?>
" title="<?php 
    echo $imageTitle;
Esempio n. 4
0
            Yii::app()->facebook->ogTags['og:image'] = $productImage != "" ? "http://" . Yii::app()->request->baseUrl . "/" . $productImage->fileHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($productImage->file, 'm')) : "http://" . Yii::app()->request->serverName . Yii::app()->request->baseUrl . "/images/admin/admin_logo.jpg";
        }
        ?>
	
						<a href="<?php 
        echo Yii::app()->request->baseUrl . "/" . $productImage->fileHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($productImage->file, 'm'));
        ?>
" title="<?php 
        echo $productTitle;
        ?>
"<?php 
        echo $i == 0 ? '' : ' class="hidden-photo"';
        ?>
>
							<img src="<?php 
        echo Yii::app()->request->baseUrl . "/" . $productImage->fileHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($productImage->file, 'm'));
        ?>
" alt="<?php 
        echo $productTitle;
        ?>
" title="<?php 
        echo Yii::t('productModule.common', 'Cliquez pour agrandir limage');
        ?>
" class="img-responsive" />
						</a>
						
						<?php 
        $i++;
    }
    $this->endWidget('ext.prettyPhoto.PrettyPhoto');
    ?>
Esempio n. 5
0
Yii::app()->clientScript->registerCssFile(Yii::app()->cms->blocs['feature']->assetsUrl . '/css/feature.css');
$nbrOfFeatures = count($bloc->features);
$featuresLayoutType = $bloc->layout;
$pageLayoutType = $this->layout == '//layouts/column1' ? 1 : 2;
$xtraClass = "";
if ($nbrOfFeatures > 2 and $pageLayoutType == 1) {
    $xtraClass = " col-md-4";
}
?>

<div class="row">

<?php 
$index = 1;
foreach ($bloc->features as $feature) {
    $featureImage = $feature->image == '' ? '' : '/' . $feature->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($feature->image, 'm'));
    ?>

	<?php 
    if ($featuresLayoutType == 1) {
        // Displaying features column style.
        ?>
	
		<div class="col-sm-6<?php 
        echo $xtraClass;
        ?>
">
		
			<div class="feature">
				
				<?php 
Esempio n. 6
0
				</p>
			</header>
			
			<div class="row">
			
				<?php 
        if ($event->image != "") {
            ?>
				
				<div class="article-image col-sm-4 col-sm-push-8">
					<a href="<?php 
            echo $detailUrl;
            ?>
">
						<img src="<?php 
            echo Yii::app()->request->baseUrl . "/" . $event->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($event->image, 's'));
            ?>
" alt="<?php 
            echo $eventTitle;
            ?>
" class="img-responsive" />
					</a>
					<p class="article-image-caption"><?php 
            echo CHtml::encode($event->image_label);
            ?>
</p>
				</div>
				
					<?php 
            $abstractContainerClass = "col-sm-8 col-sm-pull-4";
        } else {
Esempio n. 7
0
    ?>
	<div class="article-image clearfix">
		
		<?php 
    $this->beginWidget('ext.prettyPhoto.PrettyPhoto', array('id' => 'pretty_photo', 'options' => Yii::app()->params['prettyPhotoOptions']));
    ?>

		<a href="<?php 
    echo $contestImagePath . Helper::encodeFileName(Helper::fileSuffix($contest->image, 'l'));
    ?>
" title="<?php 
    echo $contestTitle;
    ?>
">
			<img src="<?php 
    echo $contestImagePath . Helper::encodeFileName(Helper::fileSuffix($contest->image, 'l'));
    ?>
" alt="<?php 
    echo $contestTitle;
    ?>
" title="<?php 
    echo Yii::t('contestModule.common', 'Cliquez pour agrandir limage');
    ?>
" class="img-responsive" />
		</a>
		
		<?php 
    $this->endWidget('ext.prettyPhoto.PrettyPhoto');
    ?>
		
	</div>
Esempio n. 8
0
						<img src="<?php 
                echo Yii::app()->request->baseUrl . "/" . $contest->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($contest->image, $imageSize));
                ?>
" alt="<?php 
                echo $contestTitle;
                ?>
" class="img-responsive" />
					</a>
					<?php 
            } else {
                ?>
					<a href="<?php 
                echo $this->createUrl('detail', array('n' => $contest->title_url));
                ?>
" style="background-image:url(<?php 
                echo Yii::app()->request->baseUrl . "/" . $contest->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($contest->image, $imageSize));
                ?>
);" title="<?php 
                echo $contestTitle;
                ?>
">
					</a>
					<?php 
            }
            ?>
				</div>
				
				<?php 
        }
        ?>
Esempio n. 9
0
 public function actionCkeditorupload($type)
 {
     $funcNum = $_GET['CKEditorFuncNum'];
     $uploadFolder = Yii::app()->params['ckeditorUploadDir'];
     $uploadedFile = CUploadedFile::getInstanceByName('upload');
     $url = '';
     $message = '';
     if (is_object($uploadedFile)) {
         if ($uploadedFile->size <= 0) {
             $message = Yii::t('admin', 'The file is of zero length.');
         } else {
             if ($type == 'image' && ($uploadedFile->type != 'image/pjpeg' && $uploadedFile->type != 'image/jpeg' && $uploadedFile->type != 'image/png')) {
                 $message = Yii::t('admin', 'The image must be in either JPG or PNG format. Please upload a JPG or PNG instead.');
             } else {
                 if ($type == 'type' && ($uploadedFile->type != 'application/pdf' && $uploadedFile->type != 'application/x-pdf')) {
                     $message = Yii::t('admin', 'The file must be in one of the following formats : PDF.');
                 } else {
                     $fileNameClean = strtolower(preg_replace('/[^A-Za-z0-9_\\-\\.]|\\.(?=.*\\.)/', '', str_replace(' ', '_', Helper::removeAccents($uploadedFile))));
                     if (strpos($fileNameClean, '.') === 0) {
                         $fileNameClean = 'file' . $fileNameClean;
                     }
                     $i = -1;
                     while (true) {
                         $i++;
                         if ($i > 0) {
                             $fileName = Helper::fileSuffix($fileNameClean, $i);
                         } else {
                             $fileName = $fileNameClean;
                         }
                         if (file_exists($uploadFolder . '/' . $fileName)) {
                             continue;
                         }
                         break;
                     }
                     if ($type == 'image') {
                         $tempFile = $uploadFolder . '/' . Helper::fileSuffix($fileName, '_t');
                         $uploadedFile->saveAs($tempFile);
                         $image = Yii::app()->image->load($tempFile);
                         $image->quality(90)->sharpen(15);
                         if ($image->width > 1000 || $image->height > 1000) {
                             $image->resize(1000, 1000);
                         }
                         $image->save($uploadFolder . '/' . $fileName);
                         unlink($tempFile);
                     } else {
                         $uploadedFile->saveAs($uploadFolder . '/' . $fileName);
                     }
                     $url = Yii::app()->request->baseUrl . '/' . $uploadFolder . '/' . $fileName;
                 }
             }
         }
     } else {
         $message = Yii::t('admin', 'There was an error uploading your file.');
     }
     echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction(" . $funcNum . ", '" . $url . "', '" . $message . "');</script>";
 }
Esempio n. 10
0
    ?>
		<div class="article-image col-sm-4 col-sm-push-8">
			
			<?php 
    $this->beginWidget('ext.prettyPhoto.PrettyPhoto', array('id' => 'pretty_photo', 'options' => Yii::app()->params['prettyPhotoOptions']));
    ?>
	
			<a href="<?php 
    echo $eventImagePath . Helper::encodeFileName(Helper::fileSuffix($event->image, 'l'));
    ?>
" title="<?php 
    echo $eventTitle;
    ?>
">
				<img src="<?php 
    echo $eventImagePath . Helper::encodeFileName(Helper::fileSuffix($event->image, 'm'));
    ?>
" alt="<?php 
    echo $eventTitle;
    ?>
" title="<?php 
    echo Yii::t('eventModule.common', 'Cliquez pour agrandir limage');
    ?>
" class="img-responsive" />
			</a>
			
			<?php 
    $this->endWidget('ext.prettyPhoto.PrettyPhoto');
    ?>
			
			<p class="article-image-caption"><?php 
Esempio n. 11
0
if ($numberOfColumns > 1) {
    if ($numberOfColumns == 2) {
        $containerClasses = "col-sm-6";
    } elseif ($numberOfColumns == 3) {
        $containerClasses = "col-sm-6 col-md-4";
    }
    ?>

<div class="row">

<?php 
}
$colIndex = 1;
foreach ($bloc->people as $person) {
    $personName = CHtml::encode($person->name);
    $personImage = $person->image == '' ? Yii::app()->cms->blocs['people']->assetsUrl . '/images/default.jpg' : '/' . $person->imageHandler->dir . "/" . Helper::encodeFileName(Helper::fileSuffix($person->image, 'm'));
    //$personImage = ($person->image == '') ? '' : '/'.$person->imageHandler->dir."/".Helper::encodeFileName(Helper::fileSuffix($person->image, 'm'));
    if ($numberOfColumns > 1) {
        ?>
	
	<div class="<?php 
        echo $containerClasses;
        ?>
">
	
	<?php 
    }
    ?>

		<dl class="vcard<?php 
    echo $personImage != "" ? " image-layout" : "";
Esempio n. 12
0
    ?>
		<div class="article-image col-sm-4 col-sm-push-8">
			
			<?php 
    $this->beginWidget('ext.prettyPhoto.PrettyPhoto', array('id' => 'pretty_photo', 'options' => Yii::app()->params['prettyPhotoOptions']));
    ?>
	
			<a href="<?php 
    echo $newsImagePath . Helper::encodeFileName(Helper::fileSuffix($news->image, 'l'));
    ?>
" title="<?php 
    echo $newsTitle;
    ?>
">
				<img src="<?php 
    echo $newsImagePath . Helper::encodeFileName(Helper::fileSuffix($news->image, 'm'));
    ?>
" alt="<?php 
    echo $newsTitle;
    ?>
" title="<?php 
    echo Yii::t('newsModule.common', 'Cliquez pour agrandir limage');
    ?>
" class="img-responsive" />
			</a>
			
			<?php 
    $this->endWidget('ext.prettyPhoto.PrettyPhoto');
    ?>
			
			<p class="article-image-caption"><?php