correction for module search in case of empty results
authorGautier Thibault <gthibault@universcine.com>
Tue, 20 Apr 2010 18:38:06 +0200
changeset 73 008defa5256d
parent 72 b1bc73ec3bcc
child 74 4801799cbf33
correction for module search in case of empty results
web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php
web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php
web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php
--- a/web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php	Tue Apr 20 18:30:24 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/actions/viewSearchListAction.class.php	Tue Apr 20 18:38:06 2010 +0200
@@ -33,6 +33,7 @@
     else
     {
       $this->searchFilms = array();
+      $this->selectedFilm = array();  
     }
     
     return sfView::SUCCESS;
--- a/web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php	Tue Apr 20 18:30:24 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php	Tue Apr 20 18:38:06 2010 +0200
@@ -79,7 +79,7 @@
 
                }
     </script>
-<div id="player-<?php echo $film->getRef(); ?>" class="player-ba" style="background:transparent url('<?php echo film_image_path($imageFilename); ?>') no-repeat;">
+<div id="player" class="player-ba" style="background:transparent url('<?php echo film_image_path($imageFilename); ?>') no-repeat;">
 <div class="infos">
 	<a href="<?php echo $actionUri; ?>" class="title"><?php echo $film->getTitle(); ?></a><br/><span class="film-infos">De <?php echo thd_render_flat_list($film->getDirectorsArray(), 'name'); ?></span>
 </div>
--- a/web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php	Tue Apr 20 18:30:24 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/viewSearchListSuccess.php	Tue Apr 20 18:38:06 2010 +0200
@@ -1,7 +1,14 @@
 <?php
+if($selectedFilm){
   $tagFilmUri = url_for('@editor?ref='.$selectedFilm->getRef().'&film_slug='.$selectedFilm->getSlugUrl());
+
 ?>
 <h3 class="head">Résultats pour : <i><?php echo $text; ?></i></h3>  
 <?php include_component( "search", "selectedFilm", array('film' => $selectedFilm, 'actionUri' => $tagFilmUri)) ?>
 <?php include_partial('search/searchList', array('selectedFilm' => $selectedFilm, 'filter' => 'all', 'filmCount' => '10', 'searchFilms' => $searchFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems)); ?>	
-
+<?php }
+else {
+?>
+<h3 class="head">Résultats pour : <i><?php echo $text; ?></i></h3>  
+Pas de résultats
+<?php } ?>