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' => '',
|
'description' => '',
|
||||||
'author' => array(),
|
'author' => array(),
|
||||||
'maintainer' => array(),
|
'maintainer' => array(),
|
||||||
'version' => ''
|
'version' => '',
|
||||||
|
'requires' => ''
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!is_file("addon/$plugin/$plugin.php"))
|
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;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1275,7 +1275,7 @@ function admin_page_plugins(&$a){
|
|||||||
'$str_minversion' => t('Minimum project version: '),
|
'$str_minversion' => t('Minimum project version: '),
|
||||||
'$str_maxversion' => t('Maximum project version: '),
|
'$str_maxversion' => t('Maximum project version: '),
|
||||||
'$str_minphpversion' => t('Minimum PHP version: '),
|
'$str_minphpversion' => t('Minimum PHP version: '),
|
||||||
|
'$str_requires' => t('Requires: '),
|
||||||
'$disabled' => t('Disabled - version incompatibility'),
|
'$disabled' => t('Disabled - version incompatibility'),
|
||||||
|
|
||||||
'$admin_form' => $admin_form,
|
'$admin_form' => $admin_form,
|
||||||
|
@ -35,8 +35,6 @@ function xrd_init(&$a) {
|
|||||||
header("Content-type: application/xrd+xml");
|
header("Content-type: application/xrd+xml");
|
||||||
|
|
||||||
|
|
||||||
$tpl = get_markup_template('view/xrd_person.tpl');
|
|
||||||
|
|
||||||
$o = replace_macros(get_markup_template('xrd_person.tpl'), array(
|
$o = replace_macros(get_markup_template('xrd_person.tpl'), array(
|
||||||
'$nick' => $r[0]['channel_address'],
|
'$nick' => $r[0]['channel_address'],
|
||||||
'$accturi' => $uri,
|
'$accturi' => $uri,
|
||||||
@ -51,7 +49,7 @@ function xrd_init(&$a) {
|
|||||||
// '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention',
|
// '$salmen' => $a->get_baseurl() . '/salmon/' . $r[0]['channel_address'] . '/mention',
|
||||||
'$modexp' => 'data:application/magic-public-key,' . $salmon_key,
|
'$modexp' => 'data:application/magic-public-key,' . $salmon_key,
|
||||||
'$subscribe' => $a->get_baseurl() . '/follow?url={uri}',
|
'$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}}
|
{{if $info.minphpversion}}
|
||||||
<p class="versionlimit">{{$str_minphpversion}}{{$info.minphpversion}}</p>
|
<p class="versionlimit">{{$str_minphpversion}}{{$info.minphpversion}}</p>
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
{{if $info.requires}}
|
||||||
|
<p class="versionlimit">{{$str_requires}}{{$info.requires}}</p>
|
||||||
|
{{/if}}
|
||||||
|
|
||||||
|
|
||||||
{{foreach $info.maintainer as $a}}
|
{{foreach $info.maintainer as $a}}
|
||||||
|
Reference in New Issue
Block a user