mirror of
https://git.friendi.ca/friendica/friendica.git
synced 2025-06-09 09:04:31 +02:00
Fix EOL and EOF in Admin modules
This commit is contained in:
parent
2a035b9b2f
commit
92b415bc36
19 changed files with 1770 additions and 1760 deletions
|
@ -1,62 +1,62 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Module\Admin\Addons;
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Module\BaseAdminModule;
|
||||
|
||||
class Index extends BaseAdminModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
parent::content();
|
||||
|
||||
$a = self::getApp();
|
||||
|
||||
// reload active themes
|
||||
if (!empty($_GET['action'])) {
|
||||
parent::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons', 't');
|
||||
|
||||
switch ($_GET['action']) {
|
||||
case 'reload':
|
||||
Addon::reload();
|
||||
info('Addons reloaded');
|
||||
break;
|
||||
|
||||
case 'toggle' :
|
||||
$addon = defaults($_GET, 'addon', '');
|
||||
if (Addon::isEnabled($addon)) {
|
||||
Addon::uninstall($addon);
|
||||
info(L10n::t('Addon %s disabled.', $addon));
|
||||
} elseif (Addon::install($addon)) {
|
||||
info(L10n::t('Addon %s enabled.', $addon));
|
||||
} else {
|
||||
info(L10n::t('Addon %s failed to install.', $addon));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$a->internalRedirect('admin/addons');
|
||||
}
|
||||
|
||||
$addons = Addon::getAvailableList();
|
||||
|
||||
$t = Renderer::getMarkupTemplate('admin/addons/index.tpl');
|
||||
return Renderer::replaceMacros($t, [
|
||||
'$title' => L10n::t('Administration'),
|
||||
'$page' => L10n::t('Addons'),
|
||||
'$submit' => L10n::t('Save Settings'),
|
||||
'$reload' => L10n::t('Reload active addons'),
|
||||
'$baseurl' => $a->getBaseURL(true),
|
||||
'$function' => 'addons',
|
||||
'$addons' => $addons,
|
||||
'$pcount' => count($addons),
|
||||
'$noplugshint' => L10n::t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
|
||||
'$form_security_token' => parent::getFormSecurityToken('admin_addons'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
|
||||
namespace Friendica\Module\Admin\Addons;
|
||||
|
||||
use Friendica\Core\Addon;
|
||||
use Friendica\Core\L10n;
|
||||
use Friendica\Core\Renderer;
|
||||
use Friendica\Module\BaseAdminModule;
|
||||
|
||||
class Index extends BaseAdminModule
|
||||
{
|
||||
public static function content()
|
||||
{
|
||||
parent::content();
|
||||
|
||||
$a = self::getApp();
|
||||
|
||||
// reload active themes
|
||||
if (!empty($_GET['action'])) {
|
||||
parent::checkFormSecurityTokenRedirectOnError('/admin/addons', 'admin_addons', 't');
|
||||
|
||||
switch ($_GET['action']) {
|
||||
case 'reload':
|
||||
Addon::reload();
|
||||
info('Addons reloaded');
|
||||
break;
|
||||
|
||||
case 'toggle' :
|
||||
$addon = defaults($_GET, 'addon', '');
|
||||
if (Addon::isEnabled($addon)) {
|
||||
Addon::uninstall($addon);
|
||||
info(L10n::t('Addon %s disabled.', $addon));
|
||||
} elseif (Addon::install($addon)) {
|
||||
info(L10n::t('Addon %s enabled.', $addon));
|
||||
} else {
|
||||
info(L10n::t('Addon %s failed to install.', $addon));
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
}
|
||||
|
||||
$a->internalRedirect('admin/addons');
|
||||
}
|
||||
|
||||
$addons = Addon::getAvailableList();
|
||||
|
||||
$t = Renderer::getMarkupTemplate('admin/addons/index.tpl');
|
||||
return Renderer::replaceMacros($t, [
|
||||
'$title' => L10n::t('Administration'),
|
||||
'$page' => L10n::t('Addons'),
|
||||
'$submit' => L10n::t('Save Settings'),
|
||||
'$reload' => L10n::t('Reload active addons'),
|
||||
'$baseurl' => $a->getBaseURL(true),
|
||||
'$function' => 'addons',
|
||||
'$addons' => $addons,
|
||||
'$pcount' => count($addons),
|
||||
'$noplugshint' => L10n::t('There are currently no addons available on your node. You can find the official addon repository at %1$s and might find other interesting addons in the open addon registry at %2$s', 'https://github.com/friendica/friendica-addons', 'http://addons.friendi.ca'),
|
||||
'$form_security_token' => parent::getFormSecurityToken('admin_addons'),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue