]> git.mxchange.org Git - friendica.git/commitdiff
Installed apps as array instead of string
authorFabio Comuni <fabrix.xm@gmail.com>
Wed, 31 Aug 2011 14:17:32 +0000 (16:17 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Wed, 31 Aug 2011 14:17:32 +0000 (16:17 +0200)
addon/calc/calc.php
addon/convert/convert.php
addon/sniper/sniper.php
addon/tictac/tictac.php
boot.php
mod/apps.php
view/apps.tpl [new file with mode: 0644]

index 8c079dc7a561d9a572d47cdeab78877161be2f23..47fb22d339199c8afb0d9e3ad6ba9eb4eff55a8d 100644 (file)
@@ -17,7 +17,7 @@ function calc_uninstall() {
 }\r
 \r
 function calc_app_menu($a,&$b) {\r
-       $b['app_menu'] .= '<div class="app-title"><a href="calc">Calculator</a></div>'\r
+       $b['app_menu'][] = Array('url'=>'calc', 'name'=>'Calculator')\r
 }\r
 \r
 \r
index 7a4c90a530fe097ae55536db6cd9403eceba791f..aaa56a43e0f1d1d86e649ee83b5d706950a1ab8b 100644 (file)
@@ -15,7 +15,7 @@ function convert_uninstall() {
 }\r
 \r
 function convert_app_menu($a,&$b) {\r
-       $b['app_menu'] .= '<div class="app-title"><a href="convert">Units Conversion</a></div>'\r
+       $b['app_menu'][] = Array('url'=>'convert', 'name'=>'Units Conversion')\r
 }\r
 \r
 \r
index d431a246663c999046a5483014134d56241567d3..c7d29cfdff727871aa6dcd074056e90f513b8973 100644 (file)
@@ -22,7 +22,7 @@ function sniper_uninstall() {
 }
 
 function sniper_app_menu($a,&$b) {
-    $b['app_menu'] .= '<div class="app-title"><a href="sniper">Hot Shot Sniper</a></div>';
+       $b['app_menu'][] = Array('url'=>'sniper', 'name'=>'Hot Shot Sniper'); 
 }
 
 
index d6cec08a0635359f39a686122e862db132110023..cc2701f8b380c7052aea1321569649307c40b836 100644 (file)
@@ -17,7 +17,7 @@ function tictac_uninstall() {
 }
 
 function tictac_app_menu($a,&$b) {
-       $b['app_menu'] .= '<div class="app-title"><a href="tictac">' . t('Three Dimensional Tic-Tac-Toe') . '</a></div>'
+       $b['app_menu'][] = Array('url'=>'tictac', 'name'=>'Three Dimensional Tic-Tac-Toe')
 }
 
 
index 4baa37309c4bed79759b6b11059c41e8cde2bc12..42a0f72077e9bed3c93aa57e67ae9d9f234d53d3 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -246,7 +246,7 @@ class App {
        public  $timezone;
        public  $interactive = true;
        public  $plugins;
-       public  $apps;
+       public  $apps = Array();
        public  $identities;
 
        private $scheme;
index 7a0a3f59ea1d62636a28bd7eb0bc90ac855c700c..8049b45fb3e846162b8a06ab41bfa2763b61b84a 100644 (file)
@@ -1,15 +1,18 @@
 <?php
 
-
 function apps_content(&$a) {
+       $title = t('Applications');
 
-       $o .= '<h3>' . t('Applications') . '</h3>';
-
-       if($a->apps)
-               $o .= $a->apps;
-       else
+       if(count($a->apps)==0)
                notice( t('No installed applications.') . EOL);
 
-       return $o;
 
-}
\ No newline at end of file
+       $tpl = get_markup_template("apps.tpl");
+       return replace_macros($tpl, array(
+               '$title' => $title,
+               '$apps' => $a->apps,
+       ));
+
+       
+
+}
diff --git a/view/apps.tpl b/view/apps.tpl
new file mode 100644 (file)
index 0000000..61ea9ee
--- /dev/null
@@ -0,0 +1,7 @@
+<h3>$title</h3>
+
+<ul>
+       {{ for $apps as $ap }}
+       <li><a href="$ap.url">$ap.name</a></li>
+       {{ endfor }}
+</ul>