summaryrefslogtreecommitdiff
path: root/smartyplugins/function.inlinemodule.php
diff options
context:
space:
mode:
Diffstat (limited to 'smartyplugins/function.inlinemodule.php')
-rw-r--r--smartyplugins/function.inlinemodule.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/smartyplugins/function.inlinemodule.php b/smartyplugins/function.inlinemodule.php
new file mode 100644
index 0000000..3be9001
--- /dev/null
+++ b/smartyplugins/function.inlinemodule.php
@@ -0,0 +1,21 @@
+<?php
+/**
+ * Smarty plugin
+ * @package Smarty
+ * @subpackage plugins
+ */
+
+
+/**
+ * Usage: add to the body of any .tpl file
+ * Example: {inlinemodule file="bitpackage:wiki/mod_last_modif_pages.tpl" rows="50"}
+ */
+function smarty_function_inlinemodule($params, &$gBitSmarty) {
+ global $module_rows, $module_title, $module_params;
+
+ $module_rows = ( !empty( $params['rows'] ) && is_numeric( trim( $params['rows'] ) ) ? $params['rows'] : NULL );
+ $module_title = ( !empty( $params['title'] ) ? $params['title'] : NULL );
+ $module_params = ( !empty( $params ) ? $params : NULL );
+ print $gBitSmarty->fetch( $params['file'] );
+}
+?>