add 'requires' field to plugin info to list other dependent plugins/addons and disable if dependencies are not installed/enabled
This commit is contained in:
parent
b101a8f6fb
commit
7e6febe2a6
@ -325,7 +325,8 @@ function get_plugin_info($plugin){
|
||||
'description' => '',
|
||||
'author' => array(),
|
||||
'maintainer' => array(),
|
||||
'version' => ''
|
||||
'version' => '',
|
||||
'requires' => ''
|
||||
);
|
||||
|
||||
if (!is_file("addon/$plugin/$plugin.php"))
|
||||
@ -383,6 +384,22 @@ function check_plugin_versions($info) {
|
||||
}
|
||||
}
|
||||
|
||||
if(array_key_exists('requires',$info)) {
|
||||
$arr = explode(',',$info['requires']);
|
||||
$found = true;
|
||||
if($arr) {
|
||||
foreach($arr as $test) {
|
||||
$test = trim($test);
|
||||
if(! $test)
|
||||
continue;
|
||||
if(! in_array($test,get_app()->plugins))
|
||||
$found = false;
|
||||
}
|
||||
}
|
||||
if(! $found)
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1275,7 +1275,7 @@ function admin_page_plugins(&$a){
|
||||
'$str_minversion' => t('Minimum project version: '),
|
||||
'$str_maxversion' => t('Maximum project version: '),
|
||||
'$str_minphpversion' => t('Minimum PHP version: '),
|
||||
|
||||
'$str_requires' => t('Requires: '),
|
||||
'$disabled' => t('Disabled - version incompatibility'),
|
||||
|
||||
'$admin_form' => $admin_form,
|
||||
|
@ -35,8 +35,6 @@ function xrd_init(&$a) {
|
||||
header("Content-type: application/xrd+xml");
|
||||
|
||||
|
||||
$tpl = get_markup_template('view/xrd_person.tpl');
|
||||
|
||||
$o = replace_macros(get_markup_template('xrd_person.tpl'), array(
|
||||
'$nick' => $r[0]['channel_address'],
|
||||
'$accturi' => $uri,
|
||||
@ -51,7 +49,7 @@ function xrd_init(&$a) {
|
||||
// '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention',
|
||||
'$modexp' => 'data:application/magic-public-key,' . $salmon_key,
|
||||
'$subscribe' => $a->get_baseurl() . '/follow?url={uri}',
|
||||
// '$bigkey' => salmon_key($r[0]['pubkey'])
|
||||
'$bigkey' => salmon_key($r[0]['channel_pubkey'])
|
||||
));
|
||||
|
||||
|
||||
|
@ -24,6 +24,9 @@
|
||||
{{if $info.minphpversion}}
|
||||
<p class="versionlimit">{{$str_minphpversion}}{{$info.minphpversion}}</p>
|
||||
{{/if}}
|
||||
{{if $info.requires}}
|
||||
<p class="versionlimit">{{$str_requires}}{{$info.requires}}</p>
|
||||
{{/if}}
|
||||
|
||||
|
||||
{{foreach $info.maintainer as $a}}
|
||||
|
Reference in New Issue
Block a user