Author: tkoomzaaskz
Date: 2010-02-23 13:39:51 +0100 (Tue, 23 Feb 2010)
New Revision: 28209

Modified:
   plugins/tdVideoPlugin/trunk/modules/tdSampleVideo/actions/actions.class.php
   plugins/tdVideoPlugin/trunk/package.xml
Log:
[td][video] forward404 if no video added

Modified: 
plugins/tdVideoPlugin/trunk/modules/tdSampleVideo/actions/actions.class.php
===================================================================
--- plugins/tdVideoPlugin/trunk/modules/tdSampleVideo/actions/actions.class.php 
2010-02-23 12:38:33 UTC (rev 28208)
+++ plugins/tdVideoPlugin/trunk/modules/tdSampleVideo/actions/actions.class.php 
2010-02-23 12:39:51 UTC (rev 28209)
@@ -12,23 +12,28 @@
 {
   public function executeIndex(sfWebRequest $request)
   {
+    $this->videos = Doctrine::getTable('tdVideo')
+      ->getActiveVideosQuery()
+      ->fetchArray();
+
+    $this->forward404Unless(count($this->videos) > 0);
+
     // ading default td_video layout
     $this->getResponse()->addStylesheet('/tdVideoPlugin/css/td_video');
-
-    $this->videos = 
Doctrine::getTable('tdVideo')->getActiveVideosQuery()->fetchArray();
   }
 
   public function executeShow(sfWebRequest $request)
   {
-    // ading default td_video layout
-    $this->getResponse()->addStylesheet('/tdVideoPlugin/css/td_video');
+    $this->forward404Unless($collection = Doctrine::getTable('tdVideo')
+      ->getActiveVideoByFileQuery($request->getParameter('file'))
+      ->fetchArray());
+    
+    $this->video = $collection[0];
 
-    $results = 
Doctrine::getTable('tdVideo')->getActiveVideoByFileQuery($request->getParameter('file'))->fetchArray();
-    $this->video = $results[0];
-
     // adding js flash embedding script
     
$this->getResponse()->addJavascript('/tdVideoPlugin/js/flowplayer-3.1.4.min.js');
-
+    // ading default td_video layout
+    $this->getResponse()->addStylesheet('/tdVideoPlugin/css/td_video');
     // adding default flowplayer stylesheet
     $this->getResponse()->addStylesheet('/tdVideoPlugin/css/flowplayer');
   }

Modified: plugins/tdVideoPlugin/trunk/package.xml
===================================================================
--- plugins/tdVideoPlugin/trunk/package.xml     2010-02-23 12:38:33 UTC (rev 
28208)
+++ plugins/tdVideoPlugin/trunk/package.xml     2010-02-23 12:39:51 UTC (rev 
28209)
@@ -10,10 +10,10 @@
   <email>[email protected]</email>
   <active>yes</active>
  </lead>
- <date>2010-02-21</date>
+ <date>2010-02-23</date>
  <time>11:00:00</time>
  <version>
-   <release>0.1.5</release>
+   <release>0.1.6</release>
    <api>0.1.0</api>
  </version>
  <stability>
@@ -152,6 +152,23 @@
 
    <release>
     <version>
+     <release>0.1.6</release>
+     <api>0.1.0</api>
+    </version>
+    <stability>
+     <release>beta</release>
+     <api>beta</api>
+    </stability>
+    <license uri="http://www.symfony-project.org/license";>MIT license</license>
+    <date>2010-02-23</date>
+    <license>MIT</license>
+    <notes>
+     * forward404 if no video added
+    </notes>
+   </release>
+
+   <release>
+    <version>
      <release>0.1.5</release>
      <api>0.1.0</api>
     </version>

-- 
You received this message because you are subscribed to the Google Groups 
"symfony SVN" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/symfony-svn?hl=en.

Reply via email to