From 13a0818fec4ac758fb050764fb33d90c74200cfe Mon Sep 17 00:00:00 2001 From: Jakob Sack Date: Thu, 9 Aug 2012 01:02:05 +0200 Subject: [PATCH] Be more precise regarding backgroundjobs mode --- cron.php | 6 +++--- lib/base.php | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/cron.php b/cron.php index fd46174f2bd..2bcaaff9fd9 100644 --- a/cron.php +++ b/cron.php @@ -23,9 +23,9 @@ $RUNTIME_NOSETUPFS = true; require_once('lib/base.php'); -$appmode = OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'web' ); +$appmode = OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' ); if( OC::$CLI ){ - if( $appmode == 'web' ){ + if( $appmode != 'cron' ){ OC_Appconfig::setValue( 'core', 'backgroundjob_mode', 'cron' ); } @@ -41,7 +41,7 @@ if( OC::$CLI ){ OC_BackgroundJob_Worker::doAllSteps(); } else{ - if( $appmode == 'web' ){ + if( $appmode == 'cron' ){ OC_JSON::error( array( 'data' => array( 'message' => 'Backgroundjobs are using system cron!'))); exit(); } diff --git a/lib/base.php b/lib/base.php index c3887dec2f8..090d05cdbae 100644 --- a/lib/base.php +++ b/lib/base.php @@ -227,11 +227,17 @@ class OC{ OC_Util::addScript( "jquery.infieldlabel.min" ); OC_Util::addScript( "jquery-tipsy" ); OC_Util::addScript( "oc-dialogs" ); + OC_Util::addScript( "backgroundjobs" ); OC_Util::addScript( "js" ); OC_Util::addScript( "eventsource" ); OC_Util::addScript( "config" ); //OC_Util::addScript( "multiselect" ); OC_Util::addScript('search','result'); + + if( OC_Appconfig::getValue( 'core', 'backgroundjob_mode', 'ajax' ) == 'ajax' ){ + OC_Util::addScript( 'backgroundjobs' ); + } + OC_Util::addStyle( "styles" ); OC_Util::addStyle( "multiselect" ); OC_Util::addStyle( "jquery-ui-1.8.16.custom" ); -- 2.39.5