[Openupload-svn-update] SF.net SVN: openupload:[345] trunk/lib
Status: Beta
Brought to you by:
tsdogs
|
From: <ts...@us...> - 2009-08-29 08:34:11
|
Revision: 345
http://openupload.svn.sourceforge.net/openupload/?rev=345&view=rev
Author: tsdogs
Date: 2009-08-29 08:34:03 +0000 (Sat, 29 Aug 2009)
Log Message:
-----------
separate personal plugins from smarty default ones
Added Paths:
-----------
trunk/lib/smarty_plugins/
trunk/lib/smarty_plugins/block.tr.php
trunk/lib/smarty_plugins/function.db_table.php
trunk/lib/smarty_plugins/function.tpl.php
trunk/lib/smarty_plugins/modifier.fsize_format.php
Removed Paths:
-------------
trunk/lib/smarty/plugins/block.tr.php
trunk/lib/smarty/plugins/function.db_table.php
trunk/lib/smarty/plugins/function.tpl.php
trunk/lib/smarty/plugins/modifier.fsize_format.php
Deleted: trunk/lib/smarty/plugins/block.tr.php
===================================================================
--- trunk/lib/smarty/plugins/block.tr.php 2009-08-28 15:16:42 UTC (rev 344)
+++ trunk/lib/smarty/plugins/block.tr.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -1,34 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package OpenUpload
- * @subpackage plugins
- */
-
-
-/**
- * Smarty {tr} block plugin
- *
- * Type: block
- * Name: tr
- * Purpose: Translate contained text with a user defined function "translate"
- * @author Alessandro Briosi
- * @param array
- * @param Smarty
- * @return string
- * @uses translate()
- */
-
-function smarty_block_tr($params, $content = null, &$smarty, &$repeat) {
-
- if(!$repeat){
- if (isset($content)) {
-// return htmlentities(translate($content,'template',$params));
- return translate($content, 'template',$params);
- } else {
- return '';
- }
- }
-}
-
-?>
\ No newline at end of file
Deleted: trunk/lib/smarty/plugins/function.db_table.php
===================================================================
--- trunk/lib/smarty/plugins/function.db_table.php 2009-08-28 15:16:42 UTC (rev 344)
+++ trunk/lib/smarty/plugins/function.db_table.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -1,40 +0,0 @@
-<?php
-
-
-
-function smarty_function_db_table($params, &$smarty){
-
- $data = $params['data'];
- isset($params['header'])?$headers = $params['header']:$headers=array();
- isset($params['fields'])?$fields = $params['fields']:$fields=array();
-
- $fields_set = count($fields)>0;
-
- $result = '<table '.$params['tbloptions'].'>';
- $result .= "<tbody>\n";
- if (count($headers)>0){
- $result .= '<tr>';
- foreach ($headers as $val){
- $result .= '<th>'.$val.'</th>';
- }
- $result .= '</tr>';
- }
-
- foreach ($data as $row){
- $result .= '<tr>';
- if ($fields_set) {
- foreach ($fields as $val){
- $result .= '<td>'.htmlentities($row[$val]).'</td>';
- }
- } else {
- foreach ($row as $val){
- $result .= '<td>'.htmlentities($val).'</td>';
- }
- }
- $result .= '</tr>'."\n";
- }
-
- $result .= "</tbody>\n";
- $result .= "</table>\n";
- return $result;
-}
\ No newline at end of file
Deleted: trunk/lib/smarty/plugins/function.tpl.php
===================================================================
--- trunk/lib/smarty/plugins/function.tpl.php 2009-08-28 15:16:42 UTC (rev 344)
+++ trunk/lib/smarty/plugins/function.tpl.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -1,30 +0,0 @@
-<?php
-/**
- * Smarty plugin
- * @package OpenUpload
- * @subpackage plugins
- */
-
-
-/**
- * Smarty {tpl} function plugin
- *
- * Type: function
- * Name: tpl
- * Input:
- * - file (required) - string containing template sub file
- * Purpose: Returns a file from the template folder, if it does not exsist
- * it returns a file from the default template
- * @author Alessandro Briosi
- * @param array
- * @param Smarty
- * @return string
- * @uses template_file
- */
-
-function smarty_function_tpl($params, &$smarty)
-{
- return template_file($params["file"]);
-
-}
-?>
\ No newline at end of file
Deleted: trunk/lib/smarty/plugins/modifier.fsize_format.php
===================================================================
--- trunk/lib/smarty/plugins/modifier.fsize_format.php 2009-08-28 15:16:42 UTC (rev 344)
+++ trunk/lib/smarty/plugins/modifier.fsize_format.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -1,43 +0,0 @@
-<?php
-/*
-* Smarty plugin
-* -------------------------------------------------------------
-* Type: modifier
-* Name: fsize_format
-* Version: 0.1
-* Date: 2003-02-21
-* Author: Joscha Feth, jo...@fe...
-* Purpose: formats a filesize (in bytes) to human-readable format
-* Usage: In the template, use
- {$filesize|fsize_format} => 123.45 B|KB|MB|GB|TB
- or
- {$filesize|fsize_format:"MB"} => 123.45 MB
- or
- {$filesize|fsize_format:"TB":4} => 0.0012 TB
-* Params:
- int size the filesize in bytes
- string format the format, the output shall be: B, KB, MB, GB or TB
- int precision the rounding precision
-* Install: Drop into the plugin directory
-* -------------------------------------------------------------
-*/
-function smarty_modifier_fsize_format($size,$format = '',$precision = 2)
-{
-
- //~ file measurements, could be calculated on the fly, but its faster like that
- $sizes = array();
- $sizes["TB"] = 1099511627776;
- $sizes["GB"] = 1073741824;
- $sizes["MB"] = 1048576;
- $sizes["KB"] = 1024;
- $sizes["B"] = 1;
-
- //~ get "human" filesize
- foreach($sizes AS $unit => $bytes) {
- if($size > $bytes || $unit == strtoupper($format)) {
- //~ return formatted size
- return number_format($size / $bytes,$precision)." ".$unit;
- } //~ end if
- } //~ end foreach
-} //~ end function
-?>
Copied: trunk/lib/smarty_plugins/block.tr.php (from rev 285, trunk/lib/smarty/plugins/block.tr.php)
===================================================================
--- trunk/lib/smarty_plugins/block.tr.php (rev 0)
+++ trunk/lib/smarty_plugins/block.tr.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -0,0 +1,34 @@
+<?php
+/**
+ * Smarty plugin
+ * @package OpenUpload
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {tr} block plugin
+ *
+ * Type: block
+ * Name: tr
+ * Purpose: Translate contained text with a user defined function "translate"
+ * @author Alessandro Briosi
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses translate()
+ */
+
+function smarty_block_tr($params, $content = null, &$smarty, &$repeat) {
+
+ if(!$repeat){
+ if (isset($content)) {
+// return htmlentities(translate($content,'template',$params));
+ return translate($content, 'template',$params);
+ } else {
+ return '';
+ }
+ }
+}
+
+?>
\ No newline at end of file
Property changes on: trunk/lib/smarty_plugins/block.tr.php
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Copied: trunk/lib/smarty_plugins/function.db_table.php (from rev 285, trunk/lib/smarty/plugins/function.db_table.php)
===================================================================
--- trunk/lib/smarty_plugins/function.db_table.php (rev 0)
+++ trunk/lib/smarty_plugins/function.db_table.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -0,0 +1,40 @@
+<?php
+
+
+
+function smarty_function_db_table($params, &$smarty){
+
+ $data = $params['data'];
+ isset($params['header'])?$headers = $params['header']:$headers=array();
+ isset($params['fields'])?$fields = $params['fields']:$fields=array();
+
+ $fields_set = count($fields)>0;
+
+ $result = '<table '.$params['tbloptions'].'>';
+ $result .= "<tbody>\n";
+ if (count($headers)>0){
+ $result .= '<tr>';
+ foreach ($headers as $val){
+ $result .= '<th>'.$val.'</th>';
+ }
+ $result .= '</tr>';
+ }
+
+ foreach ($data as $row){
+ $result .= '<tr>';
+ if ($fields_set) {
+ foreach ($fields as $val){
+ $result .= '<td>'.htmlentities($row[$val]).'</td>';
+ }
+ } else {
+ foreach ($row as $val){
+ $result .= '<td>'.htmlentities($val).'</td>';
+ }
+ }
+ $result .= '</tr>'."\n";
+ }
+
+ $result .= "</tbody>\n";
+ $result .= "</table>\n";
+ return $result;
+}
\ No newline at end of file
Property changes on: trunk/lib/smarty_plugins/function.db_table.php
___________________________________________________________________
Added: svn:executable
+ *
Added: svn:mergeinfo
+
Copied: trunk/lib/smarty_plugins/function.tpl.php (from rev 285, trunk/lib/smarty/plugins/function.tpl.php)
===================================================================
--- trunk/lib/smarty_plugins/function.tpl.php (rev 0)
+++ trunk/lib/smarty_plugins/function.tpl.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -0,0 +1,30 @@
+<?php
+/**
+ * Smarty plugin
+ * @package OpenUpload
+ * @subpackage plugins
+ */
+
+
+/**
+ * Smarty {tpl} function plugin
+ *
+ * Type: function
+ * Name: tpl
+ * Input:
+ * - file (required) - string containing template sub file
+ * Purpose: Returns a file from the template folder, if it does not exsist
+ * it returns a file from the default template
+ * @author Alessandro Briosi
+ * @param array
+ * @param Smarty
+ * @return string
+ * @uses template_file
+ */
+
+function smarty_function_tpl($params, &$smarty)
+{
+ return template_file($params["file"]);
+
+}
+?>
\ No newline at end of file
Property changes on: trunk/lib/smarty_plugins/function.tpl.php
___________________________________________________________________
Added: svn:mergeinfo
+
Copied: trunk/lib/smarty_plugins/modifier.fsize_format.php (from rev 285, trunk/lib/smarty/plugins/modifier.fsize_format.php)
===================================================================
--- trunk/lib/smarty_plugins/modifier.fsize_format.php (rev 0)
+++ trunk/lib/smarty_plugins/modifier.fsize_format.php 2009-08-29 08:34:03 UTC (rev 345)
@@ -0,0 +1,43 @@
+<?php
+/*
+* Smarty plugin
+* -------------------------------------------------------------
+* Type: modifier
+* Name: fsize_format
+* Version: 0.1
+* Date: 2003-02-21
+* Author: Joscha Feth, jo...@fe...
+* Purpose: formats a filesize (in bytes) to human-readable format
+* Usage: In the template, use
+ {$filesize|fsize_format} => 123.45 B|KB|MB|GB|TB
+ or
+ {$filesize|fsize_format:"MB"} => 123.45 MB
+ or
+ {$filesize|fsize_format:"TB":4} => 0.0012 TB
+* Params:
+ int size the filesize in bytes
+ string format the format, the output shall be: B, KB, MB, GB or TB
+ int precision the rounding precision
+* Install: Drop into the plugin directory
+* -------------------------------------------------------------
+*/
+function smarty_modifier_fsize_format($size,$format = '',$precision = 2)
+{
+
+ //~ file measurements, could be calculated on the fly, but its faster like that
+ $sizes = array();
+ $sizes["TB"] = 1099511627776;
+ $sizes["GB"] = 1073741824;
+ $sizes["MB"] = 1048576;
+ $sizes["KB"] = 1024;
+ $sizes["B"] = 1;
+
+ //~ get "human" filesize
+ foreach($sizes AS $unit => $bytes) {
+ if($size > $bytes || $unit == strtoupper($format)) {
+ //~ return formatted size
+ return number_format($size / $bytes,$precision)." ".$unit;
+ } //~ end if
+ } //~ end foreach
+} //~ end function
+?>
Property changes on: trunk/lib/smarty_plugins/modifier.fsize_format.php
___________________________________________________________________
Added: svn:mergeinfo
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|