From a0d19ffb7241a1c7a4b85e6d0fd58fbb2f718468 Mon Sep 17 00:00:00 2001 From: Zach Prezkuta Date: Sun, 6 Jan 2013 14:42:51 -0700 Subject: implement Smarty3 --- mod/fbrowser.php | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) (limited to 'mod/fbrowser.php') diff --git a/mod/fbrowser.php b/mod/fbrowser.php index cdcde4b17..81f47e39d 100644 --- a/mod/fbrowser.php +++ b/mod/fbrowser.php @@ -55,9 +55,17 @@ function fbrowser_content($a){ global $a; $types = Photo::supportedTypes(); $ext = $types[$rr['type']]; + + if($a->theme['template_engine'] === 'internal') { + $filename_e = template_escape($rr['filename']); + } + else { + $filename_e = $rr['filename']; + } + return array( $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['hiq'] . '.' .$ext, - template_escape($rr['filename']), + $filename_e, $a->get_baseurl() . '/photo/' . $rr['resource_id'] . '-' . $rr['loq'] . '.'. $ext ); } @@ -70,6 +78,7 @@ function fbrowser_content($a){ '$path' => $path, '$folders' => $albums, '$files' =>$files, + '$cancel' => t('Cancel'), )); @@ -83,7 +92,15 @@ function fbrowser_content($a){ function files2($rr){ global $a; list($m1,$m2) = explode("/",$rr['filetype']); $filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip"); - return array( $a->get_baseurl() . '/attach/' . $rr['id'], template_escape($rr['filename']), $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png'); + + if($a->theme['template_engine'] === 'internal') { + $filename_e = template_escape($rr['filename']); + } + else { + $filename_e = $rr['filename']; + } + + return array( $a->get_baseurl() . '/attach/' . $rr['id'], $filename_e, $a->get_baseurl() . '/images/icons/16/' . $filetype . '.png'); } $files = array_map("files2", $files); //echo "
"; var_dump($files); killme();
@@ -96,6 +113,7 @@ function fbrowser_content($a){
 					'$path' => array( array($a->get_baseurl()."/fbrowser/image/", t("Files")) ),
 					'$folders' => false,
 					'$files' =>$files,
+					'$cancel' => t('Cancel'),
 				));
 				
 			}
-- 
cgit v1.2.3


From b4a95460e65dbadaf074a414a9e3d9367e109f19 Mon Sep 17 00:00:00 2001
From: Zach Prezkuta 
Date: Sun, 6 Jan 2013 19:34:54 -0700
Subject: fix show-stopping bugs

---
 mod/fbrowser.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'mod/fbrowser.php')

diff --git a/mod/fbrowser.php b/mod/fbrowser.php
index 81f47e39d..d10d8021b 100644
--- a/mod/fbrowser.php
+++ b/mod/fbrowser.php
@@ -56,7 +56,7 @@ function fbrowser_content($a){
 				$types = Photo::supportedTypes();
 				$ext = $types[$rr['type']];
 
-				if($a->theme['template_engine'] === 'internal') {
+				if($a->get_template_engine() === 'internal') {
 					$filename_e = template_escape($rr['filename']);
 				}
 				else {
@@ -93,7 +93,7 @@ function fbrowser_content($a){
 					list($m1,$m2) = explode("/",$rr['filetype']);
 					$filetype = ( (file_exists("images/icons/$m1.png"))?$m1:"zip");
 
-					if($a->theme['template_engine'] === 'internal') {
+					if($a->get_template_engine() === 'internal') {
 						$filename_e = template_escape($rr['filename']);
 					}
 					else {
-- 
cgit v1.2.3