From d3bfb433d1d9419095e2e3d8d9bfad1977bb8d22 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 25 Nov 2013 13:20:16 +0100 Subject: add occ commands for enabling and disabling apps --- core/command/app/disable.php | 37 +++++++++++++++++++++++++++++++++++++ core/command/app/enable.php | 39 +++++++++++++++++++++++++++++++++++++++ core/register_command.php | 2 ++ 3 files changed, 78 insertions(+) create mode 100644 core/command/app/disable.php create mode 100644 core/command/app/enable.php (limited to 'core') diff --git a/core/command/app/disable.php b/core/command/app/disable.php new file mode 100644 index 00000000000..fc95739d997 --- /dev/null +++ b/core/command/app/disable.php @@ -0,0 +1,37 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Command\App; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class Disable extends Command { + protected function configure() { + $this + ->setName('app:disable') + ->setDescription('disable an app') + ->addArgument( + 'app_id', + InputArgument::REQUIRED, + 'disable the specified app' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $appId = $input->getArgument('app_id'); + if (\OC_App::isEnabled($appId)) { + \OC_App::disable($appId); + $output->writeln($appId . ' disabled'); + } else { + $output->writeln('No such app enabled: ' . $appId); + } + } +} diff --git a/core/command/app/enable.php b/core/command/app/enable.php new file mode 100644 index 00000000000..20cb55c4aab --- /dev/null +++ b/core/command/app/enable.php @@ -0,0 +1,39 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Command\App; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputArgument; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class Enable extends Command { + protected function configure() { + $this + ->setName('app:enable') + ->setDescription('enable an app') + ->addArgument( + 'app_id', + InputArgument::REQUIRED, + 'enable the specified app' + ); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $appId = $input->getArgument('app_id'); + if (\OC_App::isEnabled($appId)) { + $output->writeln($appId . ' is already enabled'); + } else if (!\OC_App::getAppPath($appId)) { + $output->writeln($appId . ' not found'); + } else { + \OC_App::enable($appId); + $output->writeln($appId . ' enabled'); + } + } +} diff --git a/core/register_command.php b/core/register_command.php index cfea1a6b888..9ca2a8660bd 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -10,3 +10,5 @@ $application->add(new OC\Core\Command\Status); $application->add(new OC\Core\Command\Db\GenerateChangeScript()); $application->add(new OC\Core\Command\Upgrade()); +$application->add(new OC\Core\Command\App\Disable()); +$application->add(new OC\Core\Command\App\Enable()); -- cgit v1.2.3 From 4dc35909b5ae83d1dd8af9b930658e1e1662e024 Mon Sep 17 00:00:00 2001 From: Morris Jobke Date: Mon, 25 Nov 2013 17:04:19 +0100 Subject: Fix navbar issue fixes #6024 --- core/css/styles.css | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'core') diff --git a/core/css/styles.css b/core/css/styles.css index 938b522a90f..5c0aa1fedc2 100644 --- a/core/css/styles.css +++ b/core/css/styles.css @@ -561,7 +561,7 @@ label.infield { cursor:text !important; top:1.05em; left:.85em; } /* NAVIGATION ------------------------------------------------------------- */ #navigation { - position: absolute; + position: fixed; top: 0; bottom: 0; left: 0; -- cgit v1.2.3 From fc1d897ea5d0b6f702f3c649637f5a83693d1ac3 Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 25 Nov 2013 17:28:01 +0100 Subject: rename app_id to app-id --- core/command/app/disable.php | 4 ++-- core/command/app/enable.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'core') diff --git a/core/command/app/disable.php b/core/command/app/disable.php index fc95739d997..dcdee92349e 100644 --- a/core/command/app/disable.php +++ b/core/command/app/disable.php @@ -19,14 +19,14 @@ class Disable extends Command { ->setName('app:disable') ->setDescription('disable an app') ->addArgument( - 'app_id', + 'app-id', InputArgument::REQUIRED, 'disable the specified app' ); } protected function execute(InputInterface $input, OutputInterface $output) { - $appId = $input->getArgument('app_id'); + $appId = $input->getArgument('app-id'); if (\OC_App::isEnabled($appId)) { \OC_App::disable($appId); $output->writeln($appId . ' disabled'); diff --git a/core/command/app/enable.php b/core/command/app/enable.php index 20cb55c4aab..f08546602ee 100644 --- a/core/command/app/enable.php +++ b/core/command/app/enable.php @@ -19,14 +19,14 @@ class Enable extends Command { ->setName('app:enable') ->setDescription('enable an app') ->addArgument( - 'app_id', + 'app-id', InputArgument::REQUIRED, 'enable the specified app' ); } protected function execute(InputInterface $input, OutputInterface $output) { - $appId = $input->getArgument('app_id'); + $appId = $input->getArgument('app-id'); if (\OC_App::isEnabled($appId)) { $output->writeln($appId . ' is already enabled'); } else if (!\OC_App::getAppPath($appId)) { -- cgit v1.2.3 From abe63bd329e1180173e249f6edbe440a289d809f Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Mon, 25 Nov 2013 17:34:16 +0100 Subject: Add occ command to list all apps --- core/command/app/listapps.php | 47 +++++++++++++++++++++++++++++++++++++++++++ core/register_command.php | 1 + 2 files changed, 48 insertions(+) create mode 100644 core/command/app/listapps.php (limited to 'core') diff --git a/core/command/app/listapps.php b/core/command/app/listapps.php new file mode 100644 index 00000000000..dc471c5453a --- /dev/null +++ b/core/command/app/listapps.php @@ -0,0 +1,47 @@ + + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. + */ + +namespace OC\Core\Command\App; + +use Symfony\Component\Console\Command\Command; +use Symfony\Component\Console\Input\InputInterface; +use Symfony\Component\Console\Output\OutputInterface; + +class ListApps extends Command { + protected function configure() { + $this + ->setName('app:list') + ->setDescription('List all available apps'); + } + + protected function execute(InputInterface $input, OutputInterface $output) { + $apps = \OC_App::getAllApps(); + $enabledApps = array(); + $disabledApps = array(); + + //sort enabled apps above disabled apps + foreach ($apps as $app) { + if (\OC_App::isEnabled($app)) { + $enabledApps[] = $app; + } else { + $disabledApps[] = $app; + } + } + + sort($enabledApps); + sort($disabledApps); + $output->writeln('Enabled:'); + foreach ($enabledApps as $app) { + $output->writeln(' - ' . $app); + } + $output->writeln('Disabled:'); + foreach ($disabledApps as $app) { + $output->writeln(' - ' . $app); + } + } +} diff --git a/core/register_command.php b/core/register_command.php index 9ca2a8660bd..144dcd3dc5d 100644 --- a/core/register_command.php +++ b/core/register_command.php @@ -12,3 +12,4 @@ $application->add(new OC\Core\Command\Db\GenerateChangeScript()); $application->add(new OC\Core\Command\Upgrade()); $application->add(new OC\Core\Command\App\Disable()); $application->add(new OC\Core\Command\App\Enable()); +$application->add(new OC\Core\Command\App\ListApps()); -- cgit v1.2.3