[Openupload-svn-update] SF.net SVN: openupload:[366] trunk/lib/smarty_plugins
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2010-03-18 18:13:54
|
Revision: 366
http://openupload.svn.sourceforge.net/openupload/?rev=366&view=rev
Author: tsdogs
Date: 2010-03-18 18:13:47 +0000 (Thu, 18 Mar 2010)
Log Message:
-----------
Add content handling plugins
Added Paths:
-----------
trunk/lib/smarty_plugins/block.addcontent.php
trunk/lib/smarty_plugins/function.content.php
Added: trunk/lib/smarty_plugins/block.addcontent.php
===================================================================
--- trunk/lib/smarty_plugins/block.addcontent.php (rev 0)
+++ trunk/lib/smarty_plugins/block.addcontent.php 2010-03-18 18:13:47 UTC (rev 366)
@@ -0,0 +1,36 @@
+<?php
+/**
+ * Smarty plugin
+ * @package OpenUpload
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {addcontent} block plugin
+ *
+ * Type: block
+ * Name: addcontent
+ * Purpose: Adds the content to the corresponding section
+ * @author Alessandro Briosi
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses app()->addContent();
+ */
+
+function smarty_block_addcontent($params, $content = null, &$smarty, &$repeat) {
+
+ if(!$repeat){
+ if (isset($content)) {
+ $name = 'page';
+ $priority = 999;
+ if (isset($params['name']))
+ $name = $params['name'];
+ if (isset($params['priority']))
+ $priority = $params['priority'];
+ return app()->addContent($content,$name,$priority);
+ }
+ }
+ return '';
+}
\ No newline at end of file
Added: trunk/lib/smarty_plugins/function.content.php
===================================================================
--- trunk/lib/smarty_plugins/function.content.php (rev 0)
+++ trunk/lib/smarty_plugins/function.content.php 2010-03-18 18:13:47 UTC (rev 366)
@@ -0,0 +1,28 @@
+<?php
+/**
+ * Smarty plugin
+ * @package OpenUpload
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {content} function plugin
+ *
+ * Type: function
+ * Name: content
+ * Purpose: Display the content previously populated by the application
+ * @author Alessandro Briosi
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses app()->addContent();
+ */
+
+function smarty_function_content($params, &$smarty) {
+
+ $name = 'page';
+ if (isset($params['name']))
+ $name = $params['name'];
+ return app()->getContent($name);
+}
\ No newline at end of file
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|