Author: sevein
Date: Sun Apr 29 22:32:20 2012
New Revision: 11558

Log:
Add realm only if resource is available to avoid PHP warnings

Modified:
   branches/2.0/apps/qubit/modules/search/templates/_box.php

Modified: branches/2.0/apps/qubit/modules/search/templates/_box.php
==============================================================================
--- branches/2.0/apps/qubit/modules/search/templates/_box.php   Sun Apr 29 
22:31:14 2012        (r11557)
+++ branches/2.0/apps/qubit/modules/search/templates/_box.php   Sun Apr 29 
22:32:20 2012        (r11558)
@@ -4,14 +4,16 @@
 
   <div id="search-realm" class="search-popover">
 
-    <?php $resource = $sf_request->getAttribute('sf_route')->resource ?>
-    <?php if ($resource instanceof QubitRepository): ?>
-      <div>
-        <label>
-          <input name="realm" type="radio" value="<?php echo $resource->id ?>">
-          <?php echo __('Search %1%', array('%1%' => render_title($resource))) 
?>
-        </label>
-      </div>
+    <?php $sf_route = $sf_request->getAttribute('sf_route') ?>
+    <?php if (isset($sf_route->resource)): ?>
+      <?php if ($sf_route->resource instanceof QubitRepository): ?>
+        <div>
+          <label>
+            <input name="realm" type="radio" value="<?php echo 
$sf_route->resource->id ?>"/>
+            <?php echo __('Search %1%', array('%1%' => 
render_title($sf_route->resource))) ?>
+          </label>
+        </div>
+      <?php endif; ?>
     <?php endif; ?>
 
     <div>

-- 
You received this message because you are subscribed to the Google Groups 
"Qubit Toolkit Commits" 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/qubit-commits?hl=en.

Reply via email to