plugins -> addons
This commit is contained in:
parent
cae0a26ac0
commit
fa6e5e4d75
@ -144,7 +144,7 @@ class Admin extends \Zotlabs\Web\Controller {
|
|||||||
'$accounts' => array( t('Registered accounts'), $accounts),
|
'$accounts' => array( t('Registered accounts'), $accounts),
|
||||||
'$pending' => array( t('Pending registrations'), $pending),
|
'$pending' => array( t('Pending registrations'), $pending),
|
||||||
'$channels' => array( t('Registered channels'), $channels),
|
'$channels' => array( t('Registered channels'), $channels),
|
||||||
'$plugins' => array( t('Active plugins'), $plugins ),
|
'$plugins' => array( t('Active addons'), $plugins ),
|
||||||
'$version' => array( t('Version'), STD_VERSION),
|
'$version' => array( t('Version'), STD_VERSION),
|
||||||
'$vmaster' => array( t('Repository version (master)'), $vmaster),
|
'$vmaster' => array( t('Repository version (master)'), $vmaster),
|
||||||
'$vdev' => array( t('Repository version (dev)'), $vdev),
|
'$vdev' => array( t('Repository version (dev)'), $vdev),
|
||||||
|
@ -2,10 +2,10 @@
|
|||||||
|
|
||||||
namespace Zotlabs\Module\Admin;
|
namespace Zotlabs\Module\Admin;
|
||||||
|
|
||||||
use \Zotlabs\Storage\GitRepo as GitRepo;
|
use \Zotlabs\Storage\GitRepo;
|
||||||
use \Michelf\MarkdownExtra;
|
use \Michelf\MarkdownExtra;
|
||||||
|
|
||||||
class Plugins {
|
class Addons {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief
|
* @brief
|
||||||
@ -20,7 +20,7 @@ class Plugins {
|
|||||||
$func($a);
|
$func($a);
|
||||||
}
|
}
|
||||||
|
|
||||||
goaway(z_root() . '/admin/plugins/' . argv(2) );
|
goaway(z_root() . '/admin/addons/' . argv(2) );
|
||||||
}
|
}
|
||||||
elseif(argc() > 2) {
|
elseif(argc() > 2) {
|
||||||
switch(argv(2)) {
|
switch(argv(2)) {
|
||||||
@ -243,7 +243,7 @@ class Plugins {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Plugins admin page.
|
* @brief Addons admin page.
|
||||||
*
|
*
|
||||||
* @return string with parsed HTML
|
* @return string with parsed HTML
|
||||||
*/
|
*/
|
||||||
@ -278,7 +278,7 @@ class Plugins {
|
|||||||
$info['disabled'] = 1-intval($x);
|
$info['disabled'] = 1-intval($x);
|
||||||
|
|
||||||
if (x($_GET,"a") && $_GET['a']=="t"){
|
if (x($_GET,"a") && $_GET['a']=="t"){
|
||||||
check_form_security_token_redirectOnErr('/admin/plugins', 'admin_plugins', 't');
|
check_form_security_token_redirectOnErr('/admin/addons', 'admin_addons', 't');
|
||||||
$pinstalled = false;
|
$pinstalled = false;
|
||||||
// Toggle plugin status
|
// Toggle plugin status
|
||||||
$idx = array_search($plugin, \App::$plugins);
|
$idx = array_search($plugin, \App::$plugins);
|
||||||
@ -298,9 +298,9 @@ class Plugins {
|
|||||||
if($pinstalled) {
|
if($pinstalled) {
|
||||||
@require_once("addon/$plugin/$plugin.php");
|
@require_once("addon/$plugin/$plugin.php");
|
||||||
if(function_exists($plugin.'_plugin_admin'))
|
if(function_exists($plugin.'_plugin_admin'))
|
||||||
goaway(z_root() . '/admin/plugins/' . $plugin);
|
goaway(z_root() . '/admin/addons/' . $plugin);
|
||||||
}
|
}
|
||||||
goaway(z_root() . '/admin/plugins' );
|
goaway(z_root() . '/admin/addons' );
|
||||||
}
|
}
|
||||||
|
|
||||||
// display plugin details
|
// display plugin details
|
||||||
@ -339,7 +339,7 @@ class Plugins {
|
|||||||
$t = get_markup_template('admin_plugins_details.tpl');
|
$t = get_markup_template('admin_plugins_details.tpl');
|
||||||
return replace_macros($t, array(
|
return replace_macros($t, array(
|
||||||
'$title' => t('Administration'),
|
'$title' => t('Administration'),
|
||||||
'$page' => t('Plugins'),
|
'$page' => t('Addons'),
|
||||||
'$toggle' => t('Toggle'),
|
'$toggle' => t('Toggle'),
|
||||||
'$settings' => t('Settings'),
|
'$settings' => t('Settings'),
|
||||||
'$baseurl' => z_root(),
|
'$baseurl' => z_root(),
|
||||||
@ -358,11 +358,11 @@ class Plugins {
|
|||||||
'$disabled' => t('Disabled - version incompatibility'),
|
'$disabled' => t('Disabled - version incompatibility'),
|
||||||
|
|
||||||
'$admin_form' => $admin_form,
|
'$admin_form' => $admin_form,
|
||||||
'$function' => 'plugins',
|
'$function' => 'addons',
|
||||||
'$screenshot' => '',
|
'$screenshot' => '',
|
||||||
'$readme' => $readme,
|
'$readme' => $readme,
|
||||||
|
|
||||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
'$form_security_token' => get_form_security_token('admin_addons'),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -407,11 +407,11 @@ class Plugins {
|
|||||||
|
|
||||||
$admin_plugins_add_repo_form= replace_macros(
|
$admin_plugins_add_repo_form= replace_macros(
|
||||||
get_markup_template('admin_plugins_addrepo.tpl'), array(
|
get_markup_template('admin_plugins_addrepo.tpl'), array(
|
||||||
'$post' => 'admin/plugins/addrepo',
|
'$post' => 'admin/addons/addrepo',
|
||||||
'$desc' => t('Enter the public git repository URL of the plugin repo.'),
|
'$desc' => t('Enter the public git repository URL of the addon repo.'),
|
||||||
'$repoURL' => array('repoURL', t('Plugin repo git URL'), '', ''),
|
'$repoURL' => array('repoURL', t('Addon repo git URL'), '', ''),
|
||||||
'$repoName' => array('repoName', t('Custom repo name'), '', '', t('(optional)')),
|
'$repoName' => array('repoName', t('Custom repo name'), '', '', t('(optional)')),
|
||||||
'$submit' => t('Download Plugin Repo')
|
'$submit' => t('Download Addon Repo')
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
$newRepoModalID = random_string(3);
|
$newRepoModalID = random_string(3);
|
||||||
@ -434,17 +434,17 @@ class Plugins {
|
|||||||
$t = get_markup_template('admin_plugins.tpl');
|
$t = get_markup_template('admin_plugins.tpl');
|
||||||
return replace_macros($t, array(
|
return replace_macros($t, array(
|
||||||
'$title' => t('Administration'),
|
'$title' => t('Administration'),
|
||||||
'$page' => t('Plugins'),
|
'$page' => t('Addons'),
|
||||||
'$submit' => t('Submit'),
|
'$submit' => t('Submit'),
|
||||||
'$baseurl' => z_root(),
|
'$baseurl' => z_root(),
|
||||||
'$function' => 'plugins',
|
'$function' => 'addons',
|
||||||
'$plugins' => $plugins,
|
'$plugins' => $plugins,
|
||||||
'$disabled' => t('Disabled - version incompatibility'),
|
'$disabled' => t('Disabled - version incompatibility'),
|
||||||
'$form_security_token' => get_form_security_token('admin_plugins'),
|
'$form_security_token' => get_form_security_token('admin_addons'),
|
||||||
'$allowManageRepos' => $allowManageRepos,
|
'$allowManageRepos' => $allowManageRepos,
|
||||||
'$managerepos' => t('Manage Repos'),
|
'$managerepos' => t('Manage Repos'),
|
||||||
'$installedtitle' => t('Installed Plugin Repositories'),
|
'$installedtitle' => t('Installed Addon Repositories'),
|
||||||
'$addnewrepotitle' => t('Install a New Plugin Repository'),
|
'$addnewrepotitle' => t('Install a New Addon Repository'),
|
||||||
'$expandform' => false,
|
'$expandform' => false,
|
||||||
'$form' => $admin_plugins_add_repo_form,
|
'$form' => $admin_plugins_add_repo_form,
|
||||||
'$newRepoModal' => $newRepoModal,
|
'$newRepoModal' => $newRepoModal,
|
@ -24,7 +24,7 @@ class Admin {
|
|||||||
'channels' => array(z_root() . '/admin/channels/', t('Channels'), 'channels'),
|
'channels' => array(z_root() . '/admin/channels/', t('Channels'), 'channels'),
|
||||||
'security' => array(z_root() . '/admin/security/', t('Security'), 'security'),
|
'security' => array(z_root() . '/admin/security/', t('Security'), 'security'),
|
||||||
'features' => array(z_root() . '/admin/features/', t('Features'), 'features'),
|
'features' => array(z_root() . '/admin/features/', t('Features'), 'features'),
|
||||||
'plugins' => array(z_root() . '/admin/plugins/', t('Plugins'), 'plugins'),
|
'addons' => array(z_root() . '/admin/addons/', t('Addons'), 'addons'),
|
||||||
'themes' => array(z_root() . '/admin/themes/', t('Themes'), 'themes'),
|
'themes' => array(z_root() . '/admin/themes/', t('Themes'), 'themes'),
|
||||||
'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'),
|
'queue' => array(z_root() . '/admin/queue', t('Inspect queue'), 'queue'),
|
||||||
'profs' => array(z_root() . '/admin/profs', t('Profile Fields'), 'profs'),
|
'profs' => array(z_root() . '/admin/profs', t('Profile Fields'), 'profs'),
|
||||||
@ -39,7 +39,7 @@ class Admin {
|
|||||||
if($r) {
|
if($r) {
|
||||||
foreach ($r as $h){
|
foreach ($r as $h){
|
||||||
$plugin = $h['aname'];
|
$plugin = $h['aname'];
|
||||||
$plugins[] = array(z_root() . '/admin/plugins/' . $plugin, $plugin, 'plugin');
|
$plugins[] = array(z_root() . '/admin/addons/' . $plugin, $plugin, 'plugin');
|
||||||
// temp plugins with admin
|
// temp plugins with admin
|
||||||
\App::$plugins_admin[] = $plugin;
|
\App::$plugins_admin[] = $plugin;
|
||||||
}
|
}
|
||||||
@ -53,7 +53,7 @@ class Admin {
|
|||||||
$o .= replace_macros(get_markup_template('admin_aside.tpl'), array(
|
$o .= replace_macros(get_markup_template('admin_aside.tpl'), array(
|
||||||
'$admin' => $aside,
|
'$admin' => $aside,
|
||||||
'$admtxt' => t('Admin'),
|
'$admtxt' => t('Admin'),
|
||||||
'$plugadmtxt' => t('Plugin Features'),
|
'$plugadmtxt' => t('Addon Features'),
|
||||||
'$plugins' => $plugins,
|
'$plugins' => $plugins,
|
||||||
'$logtxt' => t('Logs'),
|
'$logtxt' => t('Logs'),
|
||||||
'$logs' => $logs,
|
'$logs' => $logs,
|
||||||
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@ -1,14 +1,14 @@
|
|||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>General</dt>
|
<dt>General</dt>
|
||||||
<dd>This page manages which plugins (also known as <i>addons</i>) are installed.</dd>
|
<dd>This page manages which addons (also known as <i>plugins</i>) are installed.</dd>
|
||||||
<dt>Manage Repos</dt>
|
<dt>Manage Repos</dt>
|
||||||
<dd>If your webserver has the necessary write permissions, you will see a button labeled <b>Manage Repos</b>,
|
<dd>If your webserver has the necessary write permissions, you will see a button labeled <b>Manage Repos</b>,
|
||||||
which opens a control panel for managing what plugin <i>repositories</i> are installed. These repos are
|
which opens a control panel for managing what plugin <i>repositories</i> are installed. These repos are
|
||||||
stored in <span style="font-family: monospace;">extend/addon/[repo name]/</span>. The official Hubzilla
|
stored in <span style="font-family: monospace;">extend/addon/[repo name]/</span>. The official Hubzilla
|
||||||
plugin repo can be added by entering the repo URL
|
addon repo can be added by entering the repo URL
|
||||||
<span style="font-family: monospace;">https://framagit.org/hubzilla/addons.git</span>
|
<span style="font-family: monospace;">https://framagit.org/hubzilla/addons.git</span>
|
||||||
and choosing a name for the repo such as <b>official</b>. You should see this repo in the list similar
|
and choosing a name for the repo such as <b>official</b>. You should see this repo in the list similar
|
||||||
to the following:
|
to the following:
|
||||||
<br>
|
<br>
|
||||||
<img class="img-responsive" src="doc/context/en/admin/plugins/assets/addon_repo_gui_1.png"></dd>
|
<img class="img-responsive" src="doc/context/en/admin/addons/assets/addon_repo_gui_1.png"></dd>
|
||||||
</dl>
|
</dl>
|
Before Width: | Height: | Size: 17 KiB After Width: | Height: | Size: 17 KiB |
@ -1,14 +1,14 @@
|
|||||||
<dl class="dl-horizontal">
|
<dl class="dl-horizontal">
|
||||||
<dt>General</dt>
|
<dt>General</dt>
|
||||||
<dd>Esta página gestiona qué plugins (también llamados <i>addons</i> o <i>complementos</i>) están instalados.</dd>
|
<dd>Esta página gestiona qué addons (también llamados <i>plugins</i> o <i>complementos</i>) están instalados.</dd>
|
||||||
<dt>Gestión de los repositorios</dt>
|
<dt>Gestión de los repositorios</dt>
|
||||||
<dd>Si su servidor web tiene los permisos de escritura necesarios, verá un botón etiquetado como <b>Gestión de repositorios</b>,
|
<dd>Si su servidor web tiene los permisos de escritura necesarios, verá un botón etiquetado como <b>Gestión de repositorios</b>,
|
||||||
que abre un panel de control para administrar qué <i>repositorios</i> de plugins están instalados. Estos repositorios están
|
que abre un panel de control para administrar qué <i>repositorios</i> de addons están instalados. Estos repositorios están
|
||||||
almacenados en <span style="font-family: monospace;">extend/addon/[nombre del repositorio]/</span>. El repositorio de plugins oficial de Hubzilla
|
almacenados en <span style="font-family: monospace;">extend/addon/[nombre del repositorio]/</span>. El repositorio de addons oficial de Hubzilla
|
||||||
se puede añadir escribiendo la URL del repositorio
|
se puede añadir escribiendo la URL del repositorio
|
||||||
<span style="font-family: monospace;">https://framagit.org/hubzilla/addons.git</span>
|
<span style="font-family: monospace;">https://framagit.org/hubzilla/addons.git</span>
|
||||||
y eligiendo un nombre para el repositorio como <b>oficial</b>. Debería ver este repositorio en una lista parecida
|
y eligiendo un nombre para el repositorio como <b>oficial</b>. Debería ver este repositorio en una lista parecida
|
||||||
a esta:
|
a esta:
|
||||||
<br>
|
<br>
|
||||||
<img class="img-responsive" src="doc/context/es-es/admin/plugins/assets/addon_repo_gui_1.png"></dd>
|
<img class="img-responsive" src="doc/context/es-es/admin/addons/assets/addon_repo_gui_1.png"></dd>
|
||||||
</dl>
|
</dl>
|
@ -77,7 +77,7 @@
|
|||||||
var repoName = $('#id_repoName').val();
|
var repoName = $('#id_repoName').val();
|
||||||
$('#chat-rotator').show();
|
$('#chat-rotator').show();
|
||||||
$.post(
|
$.post(
|
||||||
"/admin/plugins/addrepo", {repoURL: repoURL, repoName: repoName},
|
"/admin/addons/addrepo", {repoURL: repoURL, repoName: repoName},
|
||||||
function(response) {
|
function(response) {
|
||||||
$('#chat-rotator').hide();
|
$('#chat-rotator').hide();
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
@ -104,7 +104,7 @@
|
|||||||
var repoURL = $('#id_repoURL').val();
|
var repoURL = $('#id_repoURL').val();
|
||||||
var repoName = $('#id_repoName').val();
|
var repoName = $('#id_repoName').val();
|
||||||
$.post(
|
$.post(
|
||||||
"/admin/plugins/installrepo", {repoURL: repoURL, repoName: repoName},
|
"/admin/addons/installrepo", {repoURL: repoURL, repoName: repoName},
|
||||||
function(response) {
|
function(response) {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
$('#generic-modal-title-{{$newRepoModalID}}').html('Addon repo installed');
|
$('#generic-modal-title-{{$newRepoModalID}}').html('Addon repo installed');
|
||||||
@ -137,7 +137,7 @@
|
|||||||
function updateAddonRepo(repoName) {
|
function updateAddonRepo(repoName) {
|
||||||
if(confirm('Are you sure you want to update the addon repo ' + repoName + '?')) {
|
if(confirm('Are you sure you want to update the addon repo ' + repoName + '?')) {
|
||||||
$.post(
|
$.post(
|
||||||
"/admin/plugins/updaterepo", {repoName: repoName},
|
"/admin/addons/updaterepo", {repoName: repoName},
|
||||||
function(response) {
|
function(response) {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
window.console.log('Addon repo '+repoName+' successfully updated :' + response['message']);
|
window.console.log('Addon repo '+repoName+' successfully updated :' + response['message']);
|
||||||
@ -170,7 +170,7 @@
|
|||||||
// TODO: Unlink the addons
|
// TODO: Unlink the addons
|
||||||
if(confirm('Are you sure you want to remove the addon repo ' + repoName + '?')) {
|
if(confirm('Are you sure you want to remove the addon repo ' + repoName + '?')) {
|
||||||
$.post(
|
$.post(
|
||||||
"/admin/plugins/removerepo", {repoName: repoName},
|
"/admin/addons/removerepo", {repoName: repoName},
|
||||||
function(response) {
|
function(response) {
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
window.console.log('Addon repo '+repoName+' successfully removed :' + response['message']);
|
window.console.log('Addon repo '+repoName+' successfully removed :' + response['message']);
|
||||||
|
Reference in New Issue
Block a user