]> git.immae.eu Git - github/shaarli/Shaarli.git/commitdiff
Adding a new placeholder in render_footer hook. 408/head
authorArthurHoaro <arthur@hoa.ro>
Mon, 7 Dec 2015 10:54:18 +0000 (11:54 +0100)
committerArthurHoaro <arthur@hoa.ro>
Tue, 8 Dec 2015 15:02:46 +0000 (16:02 +0100)
Allow free elements at the end of the page.

plugins/demo_plugin/custom_demo.css
plugins/demo_plugin/demo_plugin.php
tpl/page.footer.html

index ab1720b5a6a8f474c1235972c1bbd5ff86eeaecf..af5e8bf95e7f83e520d3b36df3f0d8fe3f0b3d50 100644 (file)
@@ -4,4 +4,10 @@
 
 .upper_plugin_demo {
     float: left;
+}
+
+#demo_marquee {
+       background: darkmagenta;
+       color: white;
+       font-weight: bold;
 }
\ No newline at end of file
index 84763c2b25050e05b5afa692178536fe128c3c81..f03ddb2b5fd340faf6e4b3d422c99ec76369a93c 100644 (file)
@@ -74,6 +74,7 @@ function hook_demo_plugin_render_includes($data)
  *
  * Template placeholders:
  *   - text
+ *   - endofpage
  *   - js_files
  *
  * Data:
@@ -89,6 +90,11 @@ function hook_demo_plugin_render_footer($data)
     // footer text
     $data['text'][] = 'Shaarli is now enhanced by the awesome demo_plugin.';
 
+    // Free elements at the end of the page.
+    $data['endofpage'][] = '<marquee id="demo_marquee">' .
+            'DEMO: it\'s 1999 all over again!' .
+        '</marquee>';
+
     // List of plugin's JS files.
     // Note that you just need to specify CSS path.
     $data['js_files'][] = PluginManager::$PLUGINS_PATH . '/demo_plugin/demo_plugin.js';
index b20aae540adab9b9c6d7ca277ac342dc06ef3524..195dada049cdbd9fb3642dba25a4cee16a888fdf 100644 (file)
@@ -4,6 +4,11 @@
         {$value}
     {/loop}
 </div>
+
+{loop="$plugins_footer.endofpage"}
+    {$value}
+{/loop}
+
 {if="$newVersion"}
 <div id="newversion">
   <span id="version_id">&#x25CF;</span> Shaarli {$newVersion} is