[dev] Trean path attempt #2

Michael Pawlowsky mjpawlowsky at yahoo.com
Tue Jan 14 07:16:01 PST 2003


Ok I re-read the style doc in horde/docs. And I'm
guessing it's the spaces that did not follow the
style. 

So here it is again.
As for fixing the cols problems. It does. If you look
in the code there is one <td> dreated for the word
"Categories" and another for the "New Sub-Category".
Total colspan = 2.

So if you have a display on one line you need to have
it have a colspan of two for the bookmarks. This will
only happend if there is a display option of one.


--- bookmarks.inc.cvs	2003-01-14 10:05:43.000000000
-0500
+++ bookmarks.inc	2003-01-14 10:07:44.000000000 -0500
@@ -17,19 +17,25 @@
       </tr>
 <?php
 $i = 0;
+$j = 1;
 $template = TREAN_TEMPLATES . '/bookmark/' .
$prefs->getValue('bookmark_template') . '.inc';
 foreach ($bookmarks as $id => $bookmark) {
+    
+    $tdclass = $j&1 ? "item0" : "item1";
+        
     if ($i == 0) {
-        echo '<tr><td style="padding: 5px" width="' .
floor(100/$cols) . '%">';
+        echo "<tr><td class=\"" . $tdclass . "\"
colspan=\"" . ($cols == 1 ? 2 : 1) . "\"
style=\"padding: 5px\" width=\"" . floor(100/$cols) .
"%\">";
     } else {
-        echo '<td style="padding: 5px" width="' .
floor(100/$cols) . '%">';
+        echo "<td class=\"" . $tdclass . "\"
colspan=\"" . ($cols ==1 ? 2 : 1) . "\"
style=\"padding: 5px\" width=\"" . floor(100/$cols) .
"%\">";
     }
 
     $bookmark->displayHTML($template,
Horde::getFormData('category', '-1'), $id);
     $i++;
+    $j++;    
     if ($i == $cols) {
         echo "</td></tr>\n";
         $i = 0;
+        $cols & 1 ? $j : $j++;        
     } else {
         echo "</td>\n";
     }


---------------------  End patch ------------------

P.S. If there are other style problems I would really
appreciate if you could simply point them out to me
and I will make sure that they get corrected.


More information about the dev mailing list