Browse Source

Installed apps as array instead of string

tags/2.32
Fabio Comuni 9 years ago
parent
commit
71d44d78ec
7 changed files with 23 additions and 13 deletions
  1. +1
    -1
      addon/calc/calc.php
  2. +1
    -1
      addon/convert/convert.php
  3. +1
    -1
      addon/sniper/sniper.php
  4. +1
    -1
      addon/tictac/tictac.php
  5. +1
    -1
      boot.php
  6. +11
    -8
      mod/apps.php
  7. +7
    -0
      view/apps.tpl

+ 1
- 1
addon/calc/calc.php View File

@@ -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');
}


+ 1
- 1
addon/convert/convert.php View File

@@ -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');
}


+ 1
- 1
addon/sniper/sniper.php View 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');
}




+ 1
- 1
addon/tictac/tictac.php View 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');
}




+ 1
- 1
boot.php View File

@@ -246,7 +246,7 @@ class App {
public $timezone;
public $interactive = true;
public $plugins;
public $apps;
public $apps = Array();
public $identities;

private $scheme;


+ 11
- 8
mod/apps.php View 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;

}
$tpl = get_markup_template("apps.tpl");
return replace_macros($tpl, array(
'$title' => $title,
'$apps' => $a->apps,
));


}

+ 7
- 0
view/apps.tpl View File

@@ -0,0 +1,7 @@
<h3>$title</h3>

<ul>
{{ for $apps as $ap }}
<li><a href="$ap.url">$ap.name</a></li>
{{ endfor }}
</ul>

Loading…
Cancel
Save