the app menu takes form
This commit is contained in:
parent
99d97170de
commit
077b97eac4
@ -46,8 +46,7 @@ function parse_app_description($f) {
|
|||||||
|
|
||||||
//future expansion
|
//future expansion
|
||||||
|
|
||||||
$observer = get_observer();
|
$observer = get_app()->get_observer();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
$lines = @file($f);
|
$lines = @file($f);
|
||||||
@ -62,5 +61,46 @@ function parse_app_description($f) {
|
|||||||
if(! $ret['photo'])
|
if(! $ret['photo'])
|
||||||
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
|
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
|
||||||
|
|
||||||
|
|
||||||
|
foreach($ret as $k => $v) {
|
||||||
|
if(strpos($v,'http') === 0)
|
||||||
|
$ret[$k] = zid($v);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(array_key_exists('requires',$ret)) {
|
||||||
|
$require = trim(strtolower($ret['requires']));
|
||||||
|
switch($require) {
|
||||||
|
case 'local_user':
|
||||||
|
if(! local_user())
|
||||||
|
unset($ret);
|
||||||
|
break;
|
||||||
|
case 'observer':
|
||||||
|
if(! $observer)
|
||||||
|
unset($ret);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
if(! local_user() && feature_enabled(local_user(),$require))
|
||||||
|
unset($ret);
|
||||||
|
break;
|
||||||
|
|
||||||
|
}
|
||||||
|
logger('require: ' . print_r($ret,true));
|
||||||
|
}
|
||||||
|
if($ret) {
|
||||||
|
translate_system_apps($ret);
|
||||||
return $ret;
|
return $ret;
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
function translate_system_apps(&$arr) {
|
||||||
|
$apps = array( 'Matrix' => t('Matrix'), 'Channel Home' => t('Channel Home'), 'Profile' => t('Profile'),
|
||||||
|
'Photos' => t('Photos')
|
||||||
|
|
||||||
|
);
|
||||||
|
|
||||||
|
if(array_key_exists($arr['name'],$apps))
|
||||||
|
$arr['name'] = $apps[$arr['name']];
|
||||||
|
|
||||||
|
}
|
14
mod/apps.php
14
mod/apps.php
@ -8,14 +8,14 @@ function apps_content(&$a) {
|
|||||||
|
|
||||||
$apps = get_system_apps();
|
$apps = get_system_apps();
|
||||||
|
|
||||||
$o .= print_r($apps,true);
|
// $o .= print_r($apps,true);
|
||||||
|
|
||||||
return $o;
|
// return $o;
|
||||||
|
|
||||||
// $tpl = get_markup_template("apps.tpl");
|
|
||||||
// return replace_macros($tpl, array(
|
return replace_macros(get_markup_template('apps.tpl'), array(
|
||||||
// '$title' => t('Applications'),
|
'$title' => t('Applications'),
|
||||||
// '$apps' => $apps,
|
'$apps' => $apps,
|
||||||
// ));
|
));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,11 @@
|
|||||||
<h3>{{$title}}</h3>
|
<h3>{{$title}}</h3>
|
||||||
|
|
||||||
<ul>
|
|
||||||
{{foreach $apps as $ap}}
|
{{foreach $apps as $ap}}
|
||||||
<li>{{$ap}}</li>
|
<div class="app-container">
|
||||||
|
<a href="{{$ap.url}}"><img src="{{$ap.photo}}" width="80" height="80" />
|
||||||
|
<div class="app-name">{{$ap.name}}</div>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
{{/foreach}}
|
{{/foreach}}
|
||||||
</ul>
|
<div class="clear"></div>
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user