Exemple #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();
 }
Exemple #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>
Exemple #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;
Exemple #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');
    ?>
Exemple #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 
Exemple #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 {
Exemple #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>
Exemple #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 
        }
        ?>
Exemple #9
0
    public function actionDetail($t, $cvFormSuccess = null)
    {
        if (Yii::app()->user->getState('siteVersion') == 'mobile') {
            Yii::app()->clientScript->registerCssFile('/css/mobile/blocs.css');
            $this->layout = '//mobileLayouts/column1';
        }
        if (!is_dir('files/_user/job')) {
            mkdir('files/_user/job');
        }
        if (!is_dir('files/_user/job/cv')) {
            mkdir('files/_user/job/cv');
        }
        $this->sidebarViewFile = '/layouts/_sidebar';
        if (!($job = Job::model()->find('i18nJob.l_title_url=:t', array('t' => $t)))) {
            throw new CHttpException(404, 'The requested page does not exist.');
        }
        $jobMultilang = Job::model()->multilang()->find('i18nJob.l_title_url=:t', array('t' => $t));
        Yii::app()->languageManager->translatedGetVars['t'] = array();
        foreach (array_keys(Yii::app()->languageManager->languages) as $language) {
            Yii::app()->languageManager->translatedGetVars['t'][$language] = $jobMultilang->{'title_url_' . $language};
        }
        $this->sidebarData['currentJobId'] = $job->id;
        // Pour identification de l'emploi actuellement affiché.
        $this->sidebarData['jobs'] = Job::model()->findAll(array('condition' => 'category_id=:category_id AND active = 1', 'order' => 'title ASC', 'params' => array(':category_id' => $job->category_id)));
        $modelCv = new JobCv();
        if (isset($_POST['JobCv'])) {
            $modelCv->attributes = $_POST['JobCv'];
            $modelCv->date = date('Y-m-d h:i:s');
            if ($modelCv->save()) {
                Yii::app()->db->createCommand('INSERT INTO job_job_cv (job_id, job_cv_id) VALUES (:job_id, :job_cv_id)')->execute(array(':job_id' => $job->id, ':job_cv_id' => $cvModel->id));
                $subject = 'Postulation pour l’offre d’emploi ' . CHtml::encode($job->title);
                $body = '
				<p>Bonjour,<br/><br/>
				Vous avez reçu une postulation pour le poste cité en objet.<br/><br/>
				<a href="http://' . $_SERVER['HTTP_HOST'] . '/files/_user/jobcv/' . Helper::encodeFileName($modelCv->cv) . '" title="Cliquez ici pour télécharger le curriculum vitae">Cliquez ici pour télécharger le curriculum vitae</a></p>
				';
                if (($mailerError = Helper::sendMail($this->module->cvEmail, $subject, $body)) !== true) {
                    throw new CHttpException(500, $mailerError);
                }
                $this->redirect($this->createUrl('detail', array('cvFormSuccess' => 1, 't' => $t)) . "#msg");
            }
        }
        $this->render('detail', array('job' => $job, 'modelCv' => $modelCv, 'cvFormSuccess' => $cvFormSuccess));
    }
Exemple #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 
Exemple #11
0
Yii::app()->clientScript->registerCssFile(Yii::app()->cms->blocs['document']->assetsUrl . '/css/document.css');
$currentDate = date('Y-m-d H:i:s');
foreach ($bloc->documents as $document) {
    if ($document->datetime <= $currentDate) {
        ?>
	
		<dl>
			<dt class="<?php 
        echo preg_replace('/[^A-Za-z0-9_\\-]/', '-', $document->mime_type);
        ?>
" title="<?php 
        echo Helper::formatMimeType($document->mime_type);
        ?>
"><a href="<?php 
        echo Yii::app()->baseUrl . '/files/_user/bloc_document/' . Helper::encodeFileName($document->file);
        ?>
" title="<?php 
        echo CHtml::encode($document->title);
        ?>
"><?php 
        echo CHtml::encode($document->title);
        ?>
</a></dt>
			<dd class="publication_date"><?php 
        echo Yii::t('blocs', 'Publié le') . " " . Helper::formatDate($document->datetime, "reg");
        ?>
</dd>
			<?php 
        if ($document->description != "") {
            ?>
Exemple #12
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" : "";
Exemple #13
0
            break;
            ?>
		
		<?php 
        case 'file':
            ?>

		<?php 
            if (isset($items[$field->id])) {
                ?>
		
		<div><h2><?php 
                echo CHtml::encode($field->title);
                ?>
</h2> : <p><?php 
                echo CHtml::link('Télécharger le fichier', '/files/_user/contest_entries/' . Helper::encodeFileName($items[$field->id]), array('target' => '_blank'));
                ?>
</p></div>

		<?php 
            }
            ?>

		<?php 
            break;
            ?>
		
		<?php 
        case 'title':
            ?>
		
Exemple #14
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