Add advanced template for re-ordering indexes as an example
authorstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Aug 2006 21:31:57 +0000 (21:31 +0000)
committerstevetruckstuff <stevetruckstuff@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Fri, 18 Aug 2006 21:31:57 +0000 (21:31 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@11615 7612ce4b-ef26-0410-bec9-ea0150e637f0

templates/default/stylesheet.tpl
templates/default_advanced/images/add.png [new file with mode: 0644]
templates/default_advanced/images/delete.png [new file with mode: 0644]
templates/default_advanced/images/down.png [new file with mode: 0644]
templates/default_advanced/images/up.png [new file with mode: 0644]
templates/default_advanced/options_order.tpl [new file with mode: 0644]
templates/default_advanced/stylesheet_advanced.tpl
templates/default_advanced/template.php

index 98d92ff..6298a4d 100644 (file)
@@ -557,14 +557,11 @@ tr.odd  {
 }
 
 #optionHighlight    td.moveLink  {
-    text-align: center;
+    text-align: right;
     font-size: 75%;
+    vertical-align: bottom;
 }
 
 #optionHighlight    td.fieldName    {
     text-align: left;
 }
-
-#optionHighlight    select,input  {
-    font-size: 75%;
-}
\ No newline at end of file
diff --git a/templates/default_advanced/images/add.png b/templates/default_advanced/images/add.png
new file mode 100644 (file)
index 0000000..6ea87dd
Binary files /dev/null and b/templates/default_advanced/images/add.png differ
diff --git a/templates/default_advanced/images/delete.png b/templates/default_advanced/images/delete.png
new file mode 100644 (file)
index 0000000..eea6548
Binary files /dev/null and b/templates/default_advanced/images/delete.png differ
diff --git a/templates/default_advanced/images/down.png b/templates/default_advanced/images/down.png
new file mode 100644 (file)
index 0000000..0a8b3e7
Binary files /dev/null and b/templates/default_advanced/images/down.png differ
diff --git a/templates/default_advanced/images/up.png b/templates/default_advanced/images/up.png
new file mode 100644 (file)
index 0000000..73903d2
Binary files /dev/null and b/templates/default_advanced/images/up.png differ
diff --git a/templates/default_advanced/options_order.tpl b/templates/default_advanced/options_order.tpl
new file mode 100644 (file)
index 0000000..d6f96b9
--- /dev/null
@@ -0,0 +1,95 @@
+<?php
+/**
+ * options_order.tpl
+ *
+ * Template for changing message list field ordering.
+ * 
+ * The following variables are available in this template:
+ *      $fields         - array containing all translated field names available
+ *                        for ordering.  Array key is an integer, value is the field name
+ *      $current_order  - array containing the current ordering of fields
+ *      $not_used       - array containing fields not currently used.  Array
+ *                        key is the same as in $fields, value is the translated
+ *                        field name.
+ *      $always_show    - array containing field indexes that should always be shown
+ *                        to maintain SquirrelMail functionality, e.g. Subject
+ *      $move_up        - URL foundation to move a field up in the ordering
+ *      $move_down      - URL foundation to move a field down in the ordering
+ *      $remove         - URL foundation to remove a field from the ordering.
+ *      $add            - URL foundation to add a field to the ordering.
+ * 
+ * @copyright &copy; 1999-2006 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
+ * @subpackage templates
+ */
+
+/** add required includes **/
+include(SM_PATH . 'templates/util_global.php');
+
+/** extract template variables **/
+extract($t);
+
+/** Begin template **/
+?>
+<div id="optionHighlight">
+<table cellspacing="0">
+ <tr>
+  <td class="header1">
+   <?php echo _("Options") .' - '. _("Index Order"); ?>
+  </td>
+ </tr>
+ <tr>
+  <td>
+   <?php echo _("The index order is the order that the columns are arranged in the message index. You can add, remove, and move columns around to customize them to fit your needs.");?>
+  </td>
+ </tr>
+ <tr>
+  <td>
+   <table cellspacing="0" class="moveFields">
+    <tr>
+     <td colspan="4" class="divider">
+      <?php echo _("Reorder indexes"); ?>
+     </td>
+    </tr>
+    <?php
+        foreach ($current_order as $order=>$index) {
+            echo "   <tr>\n";
+            
+            echo "    <td class=\"moveLink\">\n" .($order > 0 ? '<a href="'. $move_up.$index .'">'.getIcon($icon_theme_path, 'up.png', _("up"), _("up")).'</a>' : '&nbsp;'). "\n    </td>\n";
+            echo "    <td class=\"moveLink\">\n" .($order < count($current_order)-1 ? '<a href="'. $move_down.$index .'">'.getIcon($icon_theme_path, 'down.png', _("down"), _("down")).'</a>' : '&nbsp;'). "\n    </td>\n";
+            echo "    <td class=\"moveLink\">\n" .(!in_array($index, $always_show) ? '<a href="'. $remove.$index .'">'.getIcon($icon_theme_path, 'delete.png', _("remove"), _("remove")).'</a>' : '&nbsp;'). "\n    </td>\n";
+            echo "    <td class=\"fieldName\">\n" .$fields[$index]. "\n    </td>\n";
+            
+            echo "   </tr>\n";
+        }
+
+    if (count($not_used) > 0) {
+        ?>
+    <tr>
+     <td colspan="4" class="divider">
+      <?php echo _("Add an index"); ?>
+     </td>
+    </tr>
+    <?php
+        foreach ($not_used as $field_id=>$name) {
+            echo "<tr>\n" .
+                 "<td colspan=\"3\" class=\"moveLink\"><a href=\"". $add.$field_id."\">".getIcon($icon_theme_path, 'add.png', _("Add"), _("Add"))."</a></td>\n" .
+                 "<td class=\"fieldName\">".htmlspecialchars($name)."</td>\n" .
+                 "</tr>\n";
+    }
+   ?>
+   </table>
+  </td>
+ </tr>
+        <?php
+    }
+ ?>
+ <tr>
+  <td>
+   <a href="../src/options.php"><?php echo _("Return to options page");?></a>   
+  </td>
+ </tr>
+</table>
+</div>
\ No newline at end of file
index 1c7bbb7..90d2dfc 100644 (file)
 extract($t);
 ?>
 
+/* advanced option order defs */
+#optionHighlight    td.divider  {
+    border-top: 1px solid <?php echo $color[0]; ?>;
+    border-bottom: 1px solid <?php echo $color[0]; ?>;
+    background: <?php echo $color[0]; ?>;
+    font-weight: bold;
+    padding-top: 2px;
+    padding-bottom: 2px;
+}
+
 /* Advanced Tree definitions */
 .dtree {
        font-size:11px;
index 809fb33..aacf78b 100644 (file)
@@ -17,7 +17,8 @@
  */
 $templates_provided = array (
                                 'left_main.tpl',
-                                'stylesheet_advanced.tpl'
+                                'stylesheet_advanced.tpl',
+                                'options_order.tpl',
                             );
 
 /**