From: <pdo...@us...> - 2007-03-10 05:48:43
|
Revision: 12332 http://squirrelmail.svn.sourceforge.net/squirrelmail/?rev=12332&view=rev Author: pdontthink Date: 2007-03-09 21:48:35 -0800 (Fri, 09 Mar 2007) Log Message: ----------- Templatize (un)collapse buttons; move all templates to default_advanced, since default template does not use preview_pane plugin. Modified Paths: -------------- trunk/squirrelmail/plugins/preview_pane/functions.php Added Paths: ----------- trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/ trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/collapse_buttons.tpl trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/empty_frame.tpl Removed Paths: ------------- trunk/squirrelmail/plugins/preview_pane/templates/default/empty_frame.tpl Modified: trunk/squirrelmail/plugins/preview_pane/functions.php =================================================================== --- trunk/squirrelmail/plugins/preview_pane/functions.php 2007-03-10 04:10:46 UTC (rev 12331) +++ trunk/squirrelmail/plugins/preview_pane/functions.php 2007-03-10 05:48:35 UTC (rev 12332) @@ -88,7 +88,7 @@ if (!show_preview_pane()) return; - global $data_dir, $username, $base_uri; + global $data_dir, $username, $base_uri, $oTemplate; $previewPane_vertical_split = getPref($data_dir, $username, 'previewPane_vertical_split', 0); if ($previewPane_vertical_split) { @@ -106,26 +106,13 @@ $previewPane_size = getPref($data_dir, $username, 'previewPane_size', 300); + $oTemplate->assign('previewPane_size', $previewPane_size); + $oTemplate->assign('base_uri', $base_uri); + $oTemplate->assign('split', $split); + $oTemplate->assign('down_arrow', $down_arrow); + $oTemplate->assign('up_arrow', $up_arrow); - $output = "\n<script type=\"text/javascript\">\n" - . "<!--\n" - . " function set_preview_pane_size(new_size)\n" - . " {\n" - . " if (document.all)\n" - . " {\n" - . " parent.document.all[\"fs2\"].$split = \"*, \" + new_size;\n" - . " }\n" - . " else if (this.document.getElementById)\n" - . " {\n" - . " parent.document.getElementById(\"fs2\").$split = \"*, \" + new_size;\n" - . " }\n" - . " }\n" - . "// -->\n</script>\n" - . '<form style="margin:0">' - . '<input type="button" value="' . $down_arrow . '" onclick="set_preview_pane_size(0)" />' - . '<input type="button" value="X" onclick="parent.bottom.document.location=\'' . $base_uri . 'plugins/preview_pane/empty_frame.php\'" />' - . '<input type="button" value="' . $up_arrow . '" onclick="set_preview_pane_size(' . $previewPane_size . ')" />' - . '</form>'; + $output = $oTemplate->fetch('plugins/preview_pane/collapse_buttons.tpl'); return array('provider_link_before' => $output); Deleted: trunk/squirrelmail/plugins/preview_pane/templates/default/empty_frame.tpl =================================================================== --- trunk/squirrelmail/plugins/preview_pane/templates/default/empty_frame.tpl 2007-03-10 04:10:46 UTC (rev 12331) +++ trunk/squirrelmail/plugins/preview_pane/templates/default/empty_frame.tpl 2007-03-10 05:48:35 UTC (rev 12332) @@ -1,23 +0,0 @@ -<?php - -/** - * empty_frame.tpl - * - * Template for showing a blank frame. - * - * @copyright © 1999-2007 The SquirrelMail Project Team - * @author Paul Lesneiwski <pa...@sq...> - * @license http://opensource.org/licenses/gpl-license.php GNU Public License - * @version $Id$ - * @package plugins - * @subpackage preview_pane - * - */ - - -// retrieve the template vars -// -extract($t); - - -?><body> Added: trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/collapse_buttons.tpl =================================================================== --- trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/collapse_buttons.tpl (rev 0) +++ trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/collapse_buttons.tpl 2007-03-10 05:48:35 UTC (rev 12332) @@ -0,0 +1,50 @@ +<?php + +/** + * collapse_buttons.tpl + * + * Template for building (un)collapse (and clear) buttons for preview pane. + * + * The following variables are available in this template: + * + $split - Either "cols" or "rows" depending on how the + * preview pane is oriented + * + $down_arrow - The value to be displayed on the collapse button + * + $up_arrow - The value to be displayed on the uncollapse button + * + $base_uri - The SquirrelMail base URI + * + $previewPane_size - The user's configured size of the preview pane + * + * @copyright © 1999-2007 The SquirrelMail Project Team + * @author Paul Lesneiwski <pa...@sq...> + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage preview_pane + * + */ + + +// retrieve the template vars +// +extract($t); + + +?><script type="text/javascript"> +<!-- + + function set_preview_pane_size(new_size) + { + if (document.all) + { + parent.document.all["fs2"].<?php echo $split; ?> = "*, " + new_size; + } + else if (this.document.getElementById) + { + parent.document.getElementById("fs2").<?php echo $split; ?> = "*, " + new_size; + } + } +// -->\n</script> +<form style="margin:0"> + <input type="button" value="<?php echo $down_arrow; ?>" onclick="set_preview_pane_size(0)" /> + <input type="button" value="X" onclick="parent.bottom.document.location='<?php echo $base_uri; ?>plugins/preview_pane/empty_frame.php'" /> + <input type="button" value="<?php echo $up_arrow; ?>" onclick="set_preview_pane_size(<?php echo $previewPane_size; ?>)" /> +</form> Added: trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/empty_frame.tpl =================================================================== --- trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/empty_frame.tpl (rev 0) +++ trunk/squirrelmail/plugins/preview_pane/templates/default_advanced/empty_frame.tpl 2007-03-10 05:48:35 UTC (rev 12332) @@ -0,0 +1,23 @@ +<?php + +/** + * empty_frame.tpl + * + * Template for showing a blank frame. + * + * @copyright © 1999-2007 The SquirrelMail Project Team + * @author Paul Lesneiwski <pa...@sq...> + * @license http://opensource.org/licenses/gpl-license.php GNU Public License + * @version $Id$ + * @package plugins + * @subpackage preview_pane + * + */ + + +// retrieve the template vars +// +extract($t); + + +?><body> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |