aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabio Comuni <fabrix.xm@gmail.com>2011-08-31 16:17:32 +0200
committerFabio Comuni <fabrix.xm@gmail.com>2011-08-31 16:17:32 +0200
commit71d44d78ec5b16a53b82f4e631b86cd8247a9b0f (patch)
tree7f95a84dd6cf8402b20ff46eff6464e1bd0b9a5b
parentd0926240a87327a7e38b822802ac192336f68791 (diff)
downloadvolse-hubzilla-71d44d78ec5b16a53b82f4e631b86cd8247a9b0f.tar.gz
volse-hubzilla-71d44d78ec5b16a53b82f4e631b86cd8247a9b0f.tar.bz2
volse-hubzilla-71d44d78ec5b16a53b82f4e631b86cd8247a9b0f.zip
Installed apps as array instead of string
-rw-r--r--addon/calc/calc.php2
-rw-r--r--addon/convert/convert.php2
-rw-r--r--addon/sniper/sniper.php2
-rw-r--r--addon/tictac/tictac.php2
-rw-r--r--boot.php2
-rw-r--r--mod/apps.php19
-rw-r--r--view/apps.tpl7
7 files changed, 23 insertions, 13 deletions
diff --git a/addon/calc/calc.php b/addon/calc/calc.php
index 8c079dc7a..47fb22d33 100644
--- a/addon/calc/calc.php
+++ b/addon/calc/calc.php
@@ -17,7 +17,7 @@ function calc_uninstall() {
}
function calc_app_menu($a,&$b) {
- $b['app_menu'] .= '<div class="app-title"><a href="calc">Calculator</a></div>';
+ $b['app_menu'][] = Array('url'=>'calc', 'name'=>'Calculator');
}
diff --git a/addon/convert/convert.php b/addon/convert/convert.php
index 7a4c90a53..aaa56a43e 100644
--- a/addon/convert/convert.php
+++ b/addon/convert/convert.php
@@ -15,7 +15,7 @@ function convert_uninstall() {
}
function convert_app_menu($a,&$b) {
- $b['app_menu'] .= '<div class="app-title"><a href="convert">Units Conversion</a></div>';
+ $b['app_menu'][] = Array('url'=>'convert', 'name'=>'Units Conversion');
}
diff --git a/addon/sniper/sniper.php b/addon/sniper/sniper.php
index d431a2466..c7d29cfdf 100644
--- a/addon/sniper/sniper.php
+++ b/addon/sniper/sniper.php
@@ -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');
}
diff --git a/addon/tictac/tictac.php b/addon/tictac/tictac.php
index d6cec08a0..cc2701f8b 100644
--- a/addon/tictac/tictac.php
+++ b/addon/tictac/tictac.php
@@ -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');
}
diff --git a/boot.php b/boot.php
index 4baa37309..42a0f7207 100644
--- 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;
diff --git a/mod/apps.php b/mod/apps.php
index 7a0a3f59e..8049b45fb 100644
--- a/mod/apps.php
+++ b/mod/apps.php
@@ -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
index 000000000..61ea9ee5f
--- /dev/null
+++ b/view/apps.tpl
@@ -0,0 +1,7 @@
+<h3>$title</h3>
+
+<ul>
+ {{ for $apps as $ap }}
+ <li><a href="$ap.url">$ap.name</a></li>
+ {{ endfor }}
+</ul>