streams/mod/apps.php

41 lines
708 B
PHP
Raw Normal View History

2011-02-19 09:01:33 +00:00
<?php
2014-05-15 23:43:42 +00:00
require_once('include/apps.php');
2011-02-19 09:01:33 +00:00
function apps_content(&$a) {
2014-06-11 04:21:50 +00:00
if(argc() == 2 && argv(1) == 'edit')
$mode = 'edit';
else
$mode = 'list';
2015-06-19 00:53:26 +00:00
$_SESSION['return_url'] = $a->cmd;
$apps = array();
2014-06-11 04:21:50 +00:00
$syslist = get_system_apps();
2015-01-29 04:56:04 +00:00
if(local_channel()) {
$list = app_list(local_channel());
2014-06-11 04:21:50 +00:00
if($list) {
foreach($list as $x) {
$syslist[] = app_encode($x);
}
}
}
2014-06-11 04:21:50 +00:00
usort($syslist,'app_name_compare');
2014-06-11 05:35:15 +00:00
// logger('apps: ' . print_r($syslist,true));
2014-06-11 04:21:50 +00:00
foreach($syslist as $app) {
$apps[] = app_render($app,$mode);
}
return replace_macros(get_markup_template('myapps.tpl'), array(
2014-12-22 15:39:04 +00:00
'$sitename' => get_config('system','sitename'),
'$title' => t('Apps'),
2014-05-16 02:54:37 +00:00
'$apps' => $apps,
));
}