aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrub <rub@piwigo.org>2007-06-13 05:17:22 +0000
committerrub <rub@piwigo.org>2007-06-13 05:17:22 +0000
commit36e0f8a4b1d0234159dfd01cc3812aa3e65ee7f6 (patch)
treed87e5ac227752c8c0724dcdeef2971755b2a073f
parent174417b8cfe43ef60ed8daf9c7657c1932eb35bb (diff)
Enhancement for the plugin development:
o Add footer block o Add useful triggers on template object Merge branch-1_7 2034:2035 into BSF git-svn-id: http://piwigo.org/svn/trunk@2036 68402e56-0260-453c-a942-63ccdbb3a9ee
-rw-r--r--include/template.php7
-rw-r--r--template/yoga/footer.tpl3
2 files changed, 9 insertions, 1 deletions
diff --git a/include/template.php b/include/template.php
index d5e296edd..9b4b20fa6 100644
--- a/include/template.php
+++ b/include/template.php
@@ -115,6 +115,8 @@ class Template {
*/
function set_filenames($filename_array)
{
+ $filename_array = trigger_event('loc_tpl_set_filenames', $filename_array, array(&$this));
+
if (!is_array($filename_array))
{
return false;
@@ -153,6 +155,7 @@ class Template {
// actually compile the template now.
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
{
+ trigger_action('loc_before_tpl_pparse', $handle, array(&$this));
// Actually compile the code now.
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle]);
}
@@ -176,6 +179,7 @@ class Template {
// actually compile the template now.
if (!isset($this->compiled_code[$handle]) || empty($this->compiled_code[$handle]))
{
+ trigger_action('loc_before_tpl_parse', $handle, array(&$this));
// Actually compile the code now.
$this->compiled_code[$handle] = $this->compile($this->uncompiled_code[$handle], true, '_str');
}
@@ -215,6 +219,7 @@ class Template {
die("Template->assign_var_from_handle(): Couldn't load template file for handle $handle");
}
+ trigger_action('loc_before_tpl_assign_var_from_handle', $handle, array(&$this));
// Compile it, with the "no echo statements" option on.
$_str = "";
$code = $this->compile($this->uncompiled_code[$handle], true, '_str');
@@ -394,7 +399,7 @@ class Template {
die("Template->loadfile(): File $filename for handle $handle is empty");
}
- $this->uncompiled_code[$handle] = $str;
+ $this->uncompiled_code[$handle] = trigger_event('tpl_load_file', $str, $handle, array(&$this));
return true;
}
diff --git a/template/yoga/footer.tpl b/template/yoga/footer.tpl
index d0f76f8ac..0a808428d 100644
--- a/template/yoga/footer.tpl
+++ b/template/yoga/footer.tpl
@@ -18,6 +18,9 @@
<!-- END contact -->
</div> <!-- copyright -->
+<!-- BEGIN footer_element -->
+{footer_element.CONTENT}
+<!-- END footer_element -->
</div> <!-- the_page -->
<!-- BEGIN debug -->