Remove some HTML from the core
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 26 Feb 2008 18:52:18 +0000 (18:52 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 26 Feb 2008 18:52:18 +0000 (18:52 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12966 7612ce4b-ef26-0410-bec9-ea0150e637f0

src/options.php
templates/default/form_close.tpl [new file with mode: 0644]
templates/default/table.tpl [new file with mode: 0644]
templates/default/table_close.tpl [new file with mode: 0644]
templates/default/table_data.tpl [new file with mode: 0644]
templates/default/table_data_close.tpl [new file with mode: 0644]
templates/default/table_row.tpl [new file with mode: 0644]
templates/default/table_row_close.tpl [new file with mode: 0644]

index b13e04a045c577e56a47a17c1ad1d930b3e93159..88ca5a6533de3749544172a44176eb908929b9d4 100644 (file)
@@ -65,6 +65,7 @@ function process_optionmode_submit($optpage, $optpage_data) {
             echo "name = '$option->name', "
                . "value = '$option->value', "
                . "new_value = '$option->new_value'\n";
+//FIXME: NO HTML IN THE CORE!
             echo "<br />";
             */
             if ($option->changed()) {
@@ -420,11 +421,12 @@ if ($optpage == SMOPT_PAGE_MAIN) {
        . create_optpage_element($optpage)
        . create_optmode_element(SMOPT_MODE_SUBMIT);
 
-//FIXME: NO HTML IN THE CORE!!
     // Wrap the template in a table to keep from breaking the hooks below
-    echo "<table cellspacing=\"0\" class=\"table_blank\">\n" .
-         " <tr>\n" .
-         "  <td colspan=\"2\">\n";
+    $oTemplate->assign('attributes', array('cellspacing' => 0, 'class' => 'table_blank'));
+    $oTemplate->display('table.tpl');
+    $oTemplate->display('table_row.tpl');
+    $oTemplate->assign('attributes', array('colspan' => 2));
+    $oTemplate->display('table_data.tpl');
 
     // This is the only variable that is needed by *just* the template.
     $oTemplate->assign('options', $optpage_data['options']);
@@ -456,18 +458,16 @@ if ($optpage == SMOPT_PAGE_MAIN) {
     $oTemplate->assign('submit_name', $submit_name);
     $oTemplate->display('options.tpl');
 
-//FIXME: need to remove HTML from here!
-    echo "  </td>\n" .
-         " </tr>\n";
+    $oTemplate->display('table_data_close.tpl');
+    $oTemplate->display('table_row_close.tpl');
 
     /* If it is not empty, trigger the inside hook. */
     if ($inside_hook_name != '') {
         do_hook($inside_hook_name, $null);
     }
 
-//FIXME: need to remove HTML from here!
-    echo "</table>\n" .
-         "</form>\n";
+    $oTemplate->display('table_close.tpl');
+    $oTemplate->display('form_close.tpl');
 
     /* If it is not empty, trigger the bottom hook. */
     if ($bottom_hook_name != '') {
diff --git a/templates/default/form_close.tpl b/templates/default/form_close.tpl
new file mode 100644 (file)
index 0000000..5649c98
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+  * form_close.tpl
+  *
+  * Template for constructing a closing form tag.
+  *
+  * The following variables are available in this template:
+  *    <NONE>
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: form_close.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+?></form>
+
diff --git a/templates/default/table.tpl b/templates/default/table.tpl
new file mode 100644 (file)
index 0000000..b528660
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+/**
+  * table.tpl
+  *
+  * Template for constructing an opening table tag.
+  *
+  * The following variables are available in this template:
+  * array  $attributes  The table attributes
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+echo '<table';
+
+foreach ($attributes as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+
+echo ">\n";
+
diff --git a/templates/default/table_close.tpl b/templates/default/table_close.tpl
new file mode 100644 (file)
index 0000000..22cde07
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+  * table_close.tpl
+  *
+  * Template for constructing a closing table tag.
+  *
+  * The following variables are available in this template:
+  *    <NONE>
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table_close.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+?></table>
+
diff --git a/templates/default/table_data.tpl b/templates/default/table_data.tpl
new file mode 100644 (file)
index 0000000..083b36e
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+/**
+  * table_data.tpl
+  *
+  * Template for constructing an opening table data tag.
+  *
+  * The following variables are available in this template:
+  * array  $attributes  The table attributes
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table_data.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+echo '<td';
+
+foreach ($attributes as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+
+echo ">\n";
+
diff --git a/templates/default/table_data_close.tpl b/templates/default/table_data_close.tpl
new file mode 100644 (file)
index 0000000..6f2a867
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+  * table_data_close.tpl
+  *
+  * Template for constructing a closing table data tag.
+  *
+  * The following variables are available in this template:
+  *    <NONE>
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table_data_close.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+?></td>
+
diff --git a/templates/default/table_row.tpl b/templates/default/table_row.tpl
new file mode 100644 (file)
index 0000000..9b5811b
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+
+/**
+  * table_row.tpl
+  *
+  * Template for constructing an opening table row tag.
+  *
+  * The following variables are available in this template:
+  * array  $attributes  The table attributes
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table_row.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+// retrieve the template vars
+//
+extract($t);
+
+
+echo '<tr';
+
+foreach ($attributes as $key => $value) {
+    echo ' ' . $key . (is_null($value) ? '' : '="' . $value . '"');
+}
+
+echo ">\n";
+
diff --git a/templates/default/table_row_close.tpl b/templates/default/table_row_close.tpl
new file mode 100644 (file)
index 0000000..4b2c9e4
--- /dev/null
@@ -0,0 +1,20 @@
+<?php
+
+/**
+  * table_row_close.tpl
+  *
+  * Template for constructing a closing table row tag.
+  *
+  * The following variables are available in this template:
+  *    <NONE>
+  *
+  * @copyright &copy; 1999-2008 The SquirrelMail Project Team
+  * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+  * @version $Id: table_row_close.tpl 12078 2007-01-07 07:28:11Z pdontthink $
+  * @package squirrelmail
+  * @subpackage templates
+  */
+
+
+?></tr>
+