[Svn] r2304 - in branches/devel-api: program/include skins/default/includes skins/default/templates

trac at roundcube.net trac at roundcube.net
Sat Feb 21 18:46:43 CET 2009


Author: thomasb
Date: 2009-02-21 11:46:42 -0600 (Sat, 21 Feb 2009)
New Revision: 2304

Modified:
   branches/devel-api/program/include/rcube_template.php
   branches/devel-api/skins/default/includes/settingstabs.html
   branches/devel-api/skins/default/templates/mail.html
   branches/devel-api/skins/default/templates/message.html
Log:
Allow plugins to insert content to template containers (server side)

Modified: branches/devel-api/program/include/rcube_template.php
===================================================================
--- branches/devel-api/program/include/rcube_template.php	2009-02-19 19:04:44 UTC (rev 2303)
+++ branches/devel-api/program/include/rcube_template.php	2009-02-21 17:46:42 UTC (rev 2304)
@@ -567,22 +567,18 @@
                 break;
 
             case 'plugin.include':
-                //rcube::tfk_debug(var_export($this->config['skin_path'], true));
-                $path = realpath($this->config['skin_path'].$attrib['file']);
-                if (!$path) {
-                    //rcube::tfk_debug("Does not exist:");
-                    //rcube::tfk_debug($this->config['skin_path']);
-                    //rcube::tfk_debug($attrib['file']);
-                    //rcube::tfk_debug($path);
-                }
-                $incl = file_get_contents($path);
-                if ($incl) {
-                    return $this->parse_xml($incl);
-                }
+                $hook = $this->app->plugins->exec_hook("template_plugin_include", $attrib);
+                return $hook['content'];
                 break;
-                
+            
+            // define a container block
             case 'container':
-                $this->command('gui_container', $attrib['name'], $attrib['id']);
+                if ($attrib['name'] && $attrib['id']) {
+                    $this->command('gui_container', $attrib['name'], $attrib['id']);
+                    // let plugins insert some content here
+                    $hook = $this->app->plugins->exec_hook("template_container", $attrib);
+                    return $hook['content'];
+                }
                 break;
 
             // return code for a specific application object

Modified: branches/devel-api/skins/default/includes/settingstabs.html
===================================================================
--- branches/devel-api/skins/default/includes/settingstabs.html	2009-02-19 19:04:44 UTC (rev 2303)
+++ branches/devel-api/skins/default/includes/settingstabs.html	2009-02-21 17:46:42 UTC (rev 2304)
@@ -1,7 +1,7 @@
 <div id="tabsbar">
-<roundcube:container name="tabs" id="tabsbar" />
 <span id="settingstabdefault" class="tablink"><roundcube:button command="preferences" type="link" label="preferences" title="editpreferences" /></span>
 <span id="settingstabfolders" class="tablink"><roundcube:button command="folders" type="link" label="folders" title="managefolders" class="tablink" /></span>
 <span id="settingstabidentities" class="tablink"><roundcube:button command="identities" type="link" label="identities" title="manageidentities" class="tablink" /></span>
+<roundcube:container name="tabs" id="tabsbar" />
 <script type="text/javascript"> if (window.rcmail) rcmail.add_onload(rcube_init_settings_tabs); </script>
 </div>

Modified: branches/devel-api/skins/default/templates/mail.html
===================================================================
--- branches/devel-api/skins/default/templates/mail.html	2009-02-19 19:04:44 UTC (rev 2303)
+++ branches/devel-api/skins/default/templates/mail.html	2009-02-21 17:46:42 UTC (rev 2304)
@@ -111,7 +111,6 @@
 </div>
 
 <div id="messagetoolbar">
-<roundcube:container name="toolbar" id="messagetoolbar" />
 <roundcube:button command="checkmail" imageSel="/images/buttons/inbox_sel.png" imageAct="/images/buttons/inbox_act.png" imagePas="/images/buttons/inbox_pas.png" width="32" height="32" title="checkmail" />
 <roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
 <roundcube:button name="markreadbutton" id="markreadbutton" image="/images/buttons/markread_act.png" width="32" height="32" title="markmessages" onclick="rcmail_ui.show_markmenu();return false" />
@@ -120,6 +119,7 @@
 <roundcube:button command="forward" imageSel="/images/buttons/forward_sel.png" imageAct="/images/buttons/forward_act.png" imagePas="/images/buttons/forward_pas.png" width="32" height="32" title="forwardmessage" />
 <roundcube:button command="delete" imageSel="/images/buttons/delete_sel.png" imageAct="/images/buttons/delete_act.png" imagePas="/images/buttons/delete_pas.png" width="32" height="32" title="deletemessage" />
 <roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
+<roundcube:container name="toolbar" id="messagetoolbar" />
 
 <div id="markmessagemenu">
   <ul class="toolbarmenu">

Modified: branches/devel-api/skins/default/templates/message.html
===================================================================
--- branches/devel-api/skins/default/templates/message.html	2009-02-19 19:04:44 UTC (rev 2303)
+++ branches/devel-api/skins/default/templates/message.html	2009-02-21 17:46:42 UTC (rev 2304)
@@ -27,7 +27,6 @@
 </div>
 
 <div id="messagetoolbar">
-<roundcube:container name="toolbar" id="messagetoolbar" />
 <roundcube:button command="list" image="/images/buttons/back_act.png" imageSel="/images/buttons/back_sel.png" imageAct="/images/buttons/back_act.png" width="32" height="32" title="backtolist" />
 <roundcube:button command="compose" imageSel="/images/buttons/compose_sel.png" imageAct="/images/buttons/compose_act.png" imagePas="/images/buttons/compose_pas.png" width="32" height="32" title="writenewmessage" />
 <roundcube:button command="reply" imageSel="/images/buttons/reply_sel.png" imageAct="/images/buttons/reply_act.png" imagePas="/images/buttons/reply_pas.png" width="32" height="32" title="replytomessage" />
@@ -37,6 +36,7 @@
 <roundcube:button command="print" imageSel="/images/buttons/print_sel.png" imageAct="/images/buttons/print_act.png" imagePas="/images/buttons/print_pas.png" width="32" height="32" title="printmessage" />
 <roundcube:button command="viewsource" imageSel="/images/buttons/source_sel.png" imageAct="/images/buttons/source_act.png" imagePas="/images/buttons/source_pas.png" width="32" height="32" title="viewsource" />
 <roundcube:object name="mailboxlist" type="select" noSelection="moveto" maxlength="25" onchange="rcmail.command('moveto', this.options[this.selectedIndex].value)" class="mboxlist" />
+<roundcube:container name="toolbar" id="messagetoolbar" />
 </div>
 
 <div id="mainscreen">

_______________________________________________
http://lists.roundcube.net/mailman/listinfo/svn



More information about the Svn mailing list