various corrections on screens. use predefined partials
authorymh <ymh.work@gmail.com>
Fri, 30 Apr 2010 17:31:10 +0200
changeset 111 a9dd18698c15
parent 110 6c31428e26ab
child 112 e367a313ba1b
various corrections on screens. use predefined partials
web/thdProject/apps/backend/modules/film/actions/actions.class.php
web/thdProject/apps/frontend/config/routing.yml
web/thdProject/apps/frontend/modules/partials/templates/_filmItem.php
web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php
web/thdProject/apps/frontend/modules/reflex/actions/components.class.php
web/thdProject/apps/frontend/modules/reflex/config/view.yml
web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php
web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php
web/thdProject/apps/frontend/modules/tag/actions/components.class.php
web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php
web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php
web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php
--- a/web/thdProject/apps/backend/modules/film/actions/actions.class.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/backend/modules/film/actions/actions.class.php	Fri Apr 30 17:31:10 2010 +0200
@@ -68,8 +68,11 @@
 	"photo"
 	);
 	
+	
 	public function executeListGenerate(sfWebRequest $request) {
 
+		$WORD_LIST = array_flip($this->WORD_LIST);
+		
         // get all films
         $videos = Doctrine_Query::create()
           ->select("v.*")
@@ -84,7 +87,7 @@
           
           for($i=0;$i<10;$i++) {
 	          $nbtags = rand(3,5);
-	          $tags = array_rand($this->WORD_LIST, $nbtags);
+	          $tags = array_rand($WORD_LIST, $nbtags);
 	          $start = rand(0,3599);
 	          $end = rand($start,3600);
               $video->addSegment($start, $end, $tags, $userUid);
--- a/web/thdProject/apps/frontend/config/routing.yml	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/config/routing.yml	Fri Apr 30 17:31:10 2010 +0200
@@ -78,9 +78,9 @@
 #########
 
 searchReflex:
-  url: /reflex/:film_uniqueid/:tag/:direction/:distance
-  param: { module: reflex, action: index, tag: all, direction: more, distance: 5 }
-  requirements: { direction: more|less, distance: \d+ }   
+  url: /reflex/:film_uniqueid/:distance/:tag
+  param: { module: reflex, action: index, tag: all, distance: 5 }
+#  requirements: { distance: '[+-]?\d+' }   
     
 ##########
 # STATIC
--- a/web/thdProject/apps/frontend/modules/partials/templates/_filmItem.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/partials/templates/_filmItem.php	Fri Apr 30 17:31:10 2010 +0200
@@ -19,7 +19,7 @@
       </span></li>
     <?php
 	    foreach($tagCloud as $tag): ?>
-	    <li class="tag-score-<?php echo $tag['count']; ?>"><a href=""><?php echo $tag['tag']; ?></a>
+	    <li class="tag-score-<?php echo $tag['count']; ?>"><a href="<?php echo url_for("@tagging?tag=".$tag['tag']);?>"><?php echo $tag['tag']; ?></a>
 	    </li>
     <?php endforeach; ?>
     </ul>
--- a/web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/reflex/actions/actions.class.php	Fri Apr 30 17:31:10 2010 +0200
@@ -17,15 +17,13 @@
   */
   public function executeIndex(sfWebRequest $request)
   {
-  	///reflex/:film_uniqueid/:tag/:direction
   	// Parse request parameters
     $format = $request->getRequestFormat();
     $this->film_uniqueid = (string) $request->getParameter('film_uniqueid');   
     $this->tag = (string) $request->getParameter('tag');
-    $this->direction = (string) $request->getParameter('direction');
     $this->distance = (int)$request->getParameter('distance');
     
-    $this->distance = $this->distance * ($this->direction=='more'?1.0:-1.0) / 100.0;
+    $this->distance = $this->distance / 100.0;
 
     $client = SonyengineClient::getInstance();
     $results = $client->engineFind($this->film_uniqueid,$this->tag,$this->distance,true);
@@ -82,7 +80,7 @@
 
         $taggedfilms = array();
         foreach($this->mostTaggedFilms as $film) {
-        	if($this->film == null || $this->film.id != $film.id) {
+        	if($this->film == null || $this->film->id != $film->id) {
                 $taggedfilms[] = $film;
             }
         }
--- a/web/thdProject/apps/frontend/modules/reflex/actions/components.class.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/reflex/actions/components.class.php	Fri Apr 30 17:31:10 2010 +0200
@@ -6,6 +6,7 @@
   public function executeTagNavigator() {
 
 	return sfView::SUCCESS;
+
   }
   
   public function executePlayer() {
--- a/web/thdProject/apps/frontend/modules/reflex/config/view.yml	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/reflex/config/view.yml	Fri Apr 30 17:31:10 2010 +0200
@@ -4,4 +4,5 @@
 
   javascripts:   [ /js/flowplayer/flowplayer-3.1.0.min.js, /js/flowplayer/uc.flowplayer.config.js]
  
-    
\ No newline at end of file
+  components:
+  
\ No newline at end of file
--- a/web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/reflex/templates/indexSuccess.php	Fri Apr 30 17:31:10 2010 +0200
@@ -5,6 +5,6 @@
 <h3 class="head">Résultats de la recherche reflexonomique</h3> 
 <?php include_component( "tag", "player", array("film"=>$film, "tag"=>$tag)); ?>
 <?php else:?>
-<h3 class="head">Pas de résultats de la recherche reflexonomique pour le tag <?php echo $tag; ?></h3> 
+<h3 class="head">Pas de résultats de la recherche reflexonomique pour le tag <?php echo $tag['tag']; ?></h3> 
 <?php endif; ?>
 <?php include_partial('tag/suggestionFilmList', array('filter' => 'all', 'filmCount' => '10', 'mostTaggedFilms' => $mostTaggedFilms, 'pageIndex' => $pageIndex, 'pageNbItems' => $pageNbItems, "tag"=>$tag)); ?> 
--- a/web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/search/templates/_selectedFilm.php	Fri Apr 30 17:31:10 2010 +0200
@@ -1,106 +1,1 @@
-<script type="text/javascript">
-    // Charge le player
-    flowplayer("player", "<?php echo flash_path('flowplayer-3.1.2.swf') ?>",
-               {
-                   clip: {url: "<?php echo video_path($filmVideo['file']); ?>",
-                          autoPlay: false,
-                          autoBuffering: true,
-                          onSeek: function() {
-                              playerSeek();
-                          }
-                         },
-
-                   plugins: {
-
-                       content: {url: "<?php echo flash_path('flowplayer.content-3.1.0.swf') ?>",
-                                 backgroundColor: 'transparent',
-                                 display: 'none',
-                                 style: {p: {fontSize: 15}}
-                                }
-
-                   },
-
-                   onLoad: function() {
-                       playerLoaded(this);
-                   },
-
-                   onUnload: function() {
-                       playerUnloaded(this);
-                   },
-                   onError: function(code,msg) {
-                       alert(msg);
-                   },
-               });
-
-
-               function loadSegments() {
-
-                   if ($f().getClip() == undefined) {
-                       window.setTimeout("loadSegments()",2000);
-                       return false;
-                   }
-
-                   var duration = Math.round($f().getClip().fullDuration*10) * 100;
-
-
-                   var segments = tagTool.segments;
-
-                   for (seg in segments) {
-                       var segd = segments[seg].sout - segments[seg].sin;
-                       var percent = Math.round(segd * 100 / duration);
-                       var offset = Math.round(segments[seg].sin * 100 / duration);
-                       var c = $('#seg_container_template').clone().removeAttr("id");
-                       $("#segments").append(c);
-                       $("span", c).html('<strong>' + tagTool.segments[seg].tag +'</strong> par ' + segments[seg].user);
-                       $("#seg_0", c).css({'margin-left': offset+'%', 'width': percent+'%'})
-                       .attr('id', 'seg_' + seg)
-                       .click(function() {
-                           seg_id = $(this).attr("id");
-                           seg_id = seg_id.substr(seg_id.indexOf('_') + 1);
-                           tagTool.playSegment(seg_id, $("#pauseAfter").val());
-                       });
-                       c.show();
-                   }
-               }
-
-
-               function playerSeek() {
-                   tagTool.rebuildCurrentTags(tagTool.player.getTime() * 1000);
-               }
-
-
-               function playerLoaded(player) {
-
-                   // Charge les tags
-    				
-
-                   tagTool.player = $f("player");
-                   tagTool.showTagInPage = false;
-
-               }
-    </script>
-<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>
-<img src="<?php echo image_path('buttons/btn_play.png'); ?>"/ id="play"></a>
-<div class="tags">
-    <ul class="item-list tag-list">
-    <li><span class="head">
-      <i>Tags liés au film :</i>
-	    </span></li>
-	    <?php 
-		    foreach($film->getTagsArray() as $item) {
-		    	if($item){ 
-		    	$tag = $item;
-		    	echo '<li class="tag-score-'.$tag['score'].'"><a href="">'.$tag.'</a>
-		      </li>';
-		        
-		    }
-	    } ?>
-	     
-	 </ul>
-</div>
-</div>
-<div class="tag-action"><a href="<?php echo $actionUri ?>" class="link-button">Tagger le film</a></div>
-
+<?php include_component('partials', 'filmItem', Array('film' => $film, 'size' => 'big')); ?>
--- a/web/thdProject/apps/frontend/modules/tag/actions/components.class.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/actions/components.class.php	Fri Apr 30 17:31:10 2010 +0200
@@ -4,11 +4,7 @@
 {
   
   public function executeTagNavigator() {
-
-  	if($this->film)
-	   return sfView::SUCCESS;
-	else
-	   return sfView::NONE;
+	return sfView::SUCCESS;
   }
   
   public function executePlayer() {
--- a/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/actions/viewTagListAction.class.php	Fri Apr 30 17:31:10 2010 +0200
@@ -6,7 +6,7 @@
   	
   	// Parse request parameters
     $format = $request->getRequestFormat();
-    $this->tag = (string) $request->getParameter('tag');   
+    $this->tag = (string) utf8_encode($request->getParameter('tag'));   
     $pageNb = (int) $this->getRequestParameter('page_nb', 1);
     $this->pageIndex = $pageNb -1;
     $this->pageNbItems = 10;
--- a/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/templates/_suggestionFilmList.php	Fri Apr 30 17:31:10 2010 +0200
@@ -1,5 +1,5 @@
 <div id="suggestionFilm-list">
-	<h3 class="head">Autre films associés au tag <?php echo "$tag"; ?></h3>
+	<h3 class="head">Autre films associés au tag <?php echo $tag; ?></h3>
 	<ul>
 	
 	<?php
--- a/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php	Fri Apr 30 12:13:18 2010 +0200
+++ b/web/thdProject/apps/frontend/modules/tag/templates/_tagNavigator.php	Fri Apr 30 17:31:10 2010 +0200
@@ -4,13 +4,11 @@
 	<ul>
 	<?php foreach($film->getDistinctTags() as $tag):?>	
 	<li>			
-		<div class="tagActivated"><a href="<?php echo url_for('@searchReflex?film_uniqueid='.$film->uniqueid.'&tag='.$tag.'&direction=less&distance=5'); ?>">-</a></div>
+		<div class="tagActivated"><a href="<?php echo url_for('@searchReflex?distance=-5&film_uniqueid='.$film->uniqueid.'&tag='.$tag); ?>">-</a></div>
 		<div class="tag"><?php echo $tag; ?></div>
-		<div class="tagActivated"><a href="<?php echo url_for('@searchReflex?film_uniqueid='.$film->uniqueid.'&tag='.$tag.'&direction=more&distance=5'); ?>">+</a><div></div>
+		<div class="tagActivated"><a href="<?php echo url_for('@searchReflex?distance=5&film_uniqueid='.$film->uniqueid.'&tag='.$tag); ?>">+</a><div></div>
 	</li>
 	<?php endforeach; ?>
     </ul>
-<?php else:?>
-    <h3>Pas de tags associés</h3>
 <?php endif;?>
 </div>