aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
authorAndrew Manning <tamanning@zoho.com>2016-05-07 22:12:12 -0400
committerAndrew Manning <tamanning@zoho.com>2016-05-07 22:12:12 -0400
commitf73a74967ec0d68756743cd17fae65a5b2245628 (patch)
tree6fa718f808d9ed35d3805fdcc0c6189109ab9521 /Zotlabs
parentbbbae3f42dc3c0596c7cf52fdc78e8f9487e5906 (diff)
downloadvolse-hubzilla-f73a74967ec0d68756743cd17fae65a5b2245628.tar.gz
volse-hubzilla-f73a74967ec0d68756743cd17fae65a5b2245628.tar.bz2
volse-hubzilla-f73a74967ec0d68756743cd17fae65a5b2245628.zip
Existing addon repos are listed on plugin page with controls for updating, removing, and switching branches.
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Module/Admin.php31
1 files changed, 28 insertions, 3 deletions
diff --git a/Zotlabs/Module/Admin.php b/Zotlabs/Module/Admin.php
index 68508fdb0..b4c372f84 100644
--- a/Zotlabs/Module/Admin.php
+++ b/Zotlabs/Module/Admin.php
@@ -1364,11 +1364,18 @@ class Admin extends \Zotlabs\Web\Controller {
get_markup_template('generic_modal.tpl'), array(
'$id' => $newRepoModalID,
'$title' => t('Install new repo'),
- '$ok' => t('OK'),
+ '$ok' => t('Install'),
'$cancel' => t('Cancel')
)
);
+ $reponames = $this->listAddonRepos();
+ $addonrepos = [];
+ foreach($reponames as $repo) {
+ $addonrepos[] = array('name' => $repo, 'description' => '');
+ // TODO: Parse repo info to provide more information about repos
+ }
+
$t = get_markup_template('admin_plugins.tpl');
return replace_macros($t, array(
'$title' => t('Administration'),
@@ -1383,10 +1390,28 @@ class Admin extends \Zotlabs\Web\Controller {
'$expandform' => false,
'$form' => $admin_plugins_add_repo_form,
'$newRepoModal' => $newRepoModal,
- '$newRepoModalID' => $newRepoModalID
+ '$newRepoModalID' => $newRepoModalID,
+ '$addonrepos' => $addonrepos,
+ '$repoUpdateButton' => t('Update'),
+ '$repoBranchButton' => t('Switch branch'),
+ '$repoRemoveButton' => t('Remove')
));
}
-
+
+ function listAddonRepos() {
+ $addonrepos = [];
+ $addonDir = __DIR__ . '/../../extend/addon/';
+ if ($handle = opendir($addonDir)) {
+ while (false !== ($entry = readdir($handle))) {
+ if ($entry != "." && $entry != "..") {
+ $addonrepos[] = $entry;
+ }
+ }
+ closedir($handle);
+ }
+ return $addonrepos;
+ }
+
static public function plugin_sort($a,$b) {
return(strcmp(strtolower($a[2]['name']),strtolower($b[2]['name'])));
}