Example #1
0
 /**
  * Registers all config options
  */
 public function registerAll()
 {
     $this->registerNavigation();
     $this->registerHooks();
     // F**k it lets just do this quick and dirty until core supports this
     Backgroundjob::addRegularTask($this->config['cron']['job'], 'run');
     App::registerAdmin($this->config['id'], $this->config['admin']);
 }
Example #2
0
<?php

/**
 * Copyright (c) 2014 - Arno van Rossum <*****@*****.**>
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
OCP\App::checkAppEnabled('ocusagecharts');
OCP\App::setActiveNavigationEntry('ocusagecharts');
OCP\App::addNavigationEntry(array('id' => 'ocusagecharts', 'order' => 60, 'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'), 'icon' => OCP\Util::imagePath('ocusagecharts', 'iconchart.png'), 'name' => \OC_L10N::get('ocusagecharts')->t('ocUsageCharts')));
\OCP\Util::addStyle('ocusagecharts', 'style');
\OCP\Backgroundjob::registerJob('OCA\\ocUsageCharts\\Command\\UpdateChartsCommand');
Example #3
0
 */
namespace OCA\Music\App;

$app = new Music();
$c = $app->getContainer();
/**
 * add navigation
 */
$navConfig = array('id' => $c->query('AppName'), 'order' => 10, 'name' => $c->query('L10N')->t('Music'), 'href' => $c->query('URLGenerator')->linkToRoute('music.page.index'), 'icon' => $c->query('URLGenerator')->imagePath($c->query('AppName'), 'music.svg'));
$c->query('ServerContainer')->getNavigationManager()->add($navConfig);
/**
 * register regular task
 */
// TODO: this is temporarily static because core jobs are not public
// yet, therefore legacy code
\OCP\Backgroundjob::addRegularTask('OCA\\Music\\Backgroundjob\\CleanUp', 'run');
/**
 * register hooks
 */
// FIXME: this is temporarily static because core emitters are not future
// proof, therefore legacy code in here
\OCP\Util::connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_post_write, 'OCA\\Music\\Hooks\\File', 'updated');
\OCP\Util::connectHook(\OC\Files\Filesystem::CLASSNAME, \OC\Files\Filesystem::signal_delete, 'OCA\\Music\\Hooks\\File', 'deleted');
\OCP\Util::connectHook('OCP\\Share', 'post_unshare', 'OCA\\Music\\Hooks\\Share', 'itemUnshared');
// TODO: disabled because it can delay the share a lot
/*
\OCP\Util::connectHook(
	'OCP\Share', 'post_shared',
	'OCA\Music\Hooks\Share', 'itemShared'
);
*/
Example #4
0
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */
use OCA\ocUsageCharts\AppInfo\Chart;
OCP\App::checkAppEnabled('ocusagecharts');
OCP\App::setActiveNavigationEntry('ocusagecharts');
OCP\App::registerPersonal('ocusagecharts', 'personal');
OCP\App::registerAdmin('ocusagecharts', 'admin');
OCP\App::addNavigationEntry(array('id' => 'ocusagecharts', 'order' => 60, 'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'), 'icon' => OCP\Util::imagePath('ocusagecharts', 'iconchart.png'), 'name' => \OC_L10N::get('ocusagecharts')->t('ocUsageCharts')));
\OCP\Util::addStyle('ocusagecharts', 'style');
\OCP\Backgroundjob::registerJob('OCA\\ocUsageCharts\\Job\\UpdateChartsJob');
$app = new Chart();
$x = $app->getContainer()->query('FileHooks');
$x->register();
$useApi = $app->getContainer()->query('ServerContainer')->getConfig()->getAppValue($app->getContainer()->query('AppName'), 'useapi');
if ($useApi) {
    \OCP\Backgroundjob::registerJob('OCA\\ocUsageCharts\\Job\\UpdateContentStatisticsJob');
}
Example #5
0
 /**
  * Register a backgroundjob task
  * @param string $className full namespace and class name of the class
  * @param string $methodName the name of the static method that should be
  * called
  * @deprecated Use \OC::$server->getJobList()->add();
  */
 public function addRegularTask($className, $methodName)
 {
     \OCP\Backgroundjob::addRegularTask($className, $methodName);
 }
Example #6
0
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is
 * furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in
 * all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
 * THE SOFTWARE.
 */

OCP\App::checkAppEnabled('ocusagecharts');
OCP\App::setActiveNavigationEntry('ocusagecharts');
OCP\App::addNavigationEntry(Array(
    'id'	=> 'ocusagecharts',
    'order'	=> 60,
    'href' => \OCP\Util::linkToRoute('ocusagecharts.chart.frontpage'),
    'icon'	=> OCP\Util::imagePath('ocusagecharts', 'iconchart.png'),
    'name'	=> \OC_L10N::get('ocusagecharts')->t('ocUsageCharts')
));


\OCP\Util::addStyle('ocusagecharts', 'style');

\OCP\Backgroundjob::registerJob('OCA\ocUsageCharts\Command\UpdateUserStorageCommand');
Example #7
0
/**
 * ownCloud - Activity App
 *
 * @author Frank Karlitschek
 * @copyright 2013 Frank Karlitschek frank@owncloud.org
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
 * License as published by the Free Software Foundation; either
 * version 3 of the License, or any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
 *
 * You should have received a copy of the GNU Affero General Public
 * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
 *
 */
$l = OC_L10N::get('activity');
// add an navigation entry
OCP\App::addNavigationEntry(array('id' => 'activity', 'order' => 1, 'href' => OCP\Util::linkToRoute('activity.index'), 'icon' => OCP\Util::imagePath('activity', 'activity.svg'), 'name' => $l->t('Activity')));
// register the hooks for filesystem operations. All other events from other apps has to be send via the public api
OCA\Activity\Hooks::register();
// Personal settings for notifications and emails
OCP\App::registerPersonal('activity', 'personal');
// Cron job for sending Emails
OCP\Backgroundjob::registerJob('OCA\\Activity\\BackgroundJob\\EmailNotification');
\OCP\Backgroundjob::registerJob('OCA\\Activity\\BackgroundJob\\ExpireActivities');
Example #8
0
 /**
  * Registers all jobs in the config
  */
 public function registerBackgroundJobs()
 {
     // FIXME: this is temporarily static because core jobs are not public
     // yet, therefore legacy code
     foreach ($this->config['jobs'] as $job) {
         \OCP\Backgroundjob::addRegularTask($job, 'run');
     }
 }
Example #9
0
 /**
  * Register a backgroundjob
  * @param \OC\BackgroundJob\Job|string $job the job instance
  * @param mixed $argument the argument passed to the run() method of the job
  * called
  */
 public function registerJob($job, $argument = null)
 {
     \OCP\Backgroundjob::registerJob($job, $argument);
 }
Example #10
0
<?php

/**
 * ownCloud - passman
 *
 * This file is licensed under the Affero General Public License version 3 or
 * later. See the COPYING file.
 *
 * @author Sander Brand <*****@*****.**>
 * @copyright Sander Brand 2014
 */
namespace OCA\Passman\AppInfo;

\OCP\App::registerAdmin('passman', 'admin-settings');
\OCP\App::addNavigationEntry(array('id' => 'passman', 'order' => 10, 'href' => \OCP\Util::linkToRoute('passman.page.index'), 'icon' => \OCP\Util::imagePath('passman', 'app.png'), 'name' => \OC_L10N::get('Passwords')->t('Passwords')));
\OCP\Backgroundjob::registerJob('OCA\\Passman\\Cron\\RunCron');
\OC::$server->getActivityManager()->registerExtension(function () {
    return new \OCA\Passman\Activity();
});
Example #11
0
File: app.php Project: miska/ocipv6
 * it under the terms of the GNU Affero General Public License, version 3,
 * as published by the Free Software Foundation.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License, version 3,
 * along with this program.  If not, see <http://www.gnu.org/licenses/>
 *
 */
namespace OCA\OCIPv6\AppInfo;

//load the required files
\OCP\Backgroundjob::addRegularTask('\\OCA\\ocipv6\\Cron\\dyndns', 'update');
\OCP\App::registerAdmin('ocipv6', 'settings/ipv6');
\OCP\App::registerAdmin('ocipv6', 'settings/upnp');
\OCP\App::registerAdmin('ocipv6', 'settings/dynv6');
use OCP\AppFramework\App;
use OCA\OCIPv6\Service\AuthorService;
class Application extends App
{
    public function __construct(array $urlParams = array())
    {
        parent::__construct('ocipv6', $urlParams);
        $container = $this->getContainer();
        /**
         * Controllers
         */
        $container->registerService('AuthorService', function ($c) {