diff options
author | Kamil Domanski <kdomanski@kdemail.net> | 2011-06-19 15:18:52 +0200 |
---|---|---|
committer | Kamil Domanski <kdomanski@kdemail.net> | 2011-06-19 15:18:52 +0200 |
commit | 6b2ec221045c2e437d5658be1bc1dc001911e1e4 (patch) | |
tree | ce86c6e203d47c0266fe2ff20a43ddcc722036d6 /lib/app.php | |
parent | d5b550395af51d1299da4600870a403b7f7921d8 (diff) | |
download | nextcloud-server-6b2ec221045c2e437d5658be1bc1dc001911e1e4.tar.gz nextcloud-server-6b2ec221045c2e437d5658be1bc1dc001911e1e4.zip |
allow disabling apps, install apps as disabled
Diffstat (limited to 'lib/app.php')
-rw-r--r-- | lib/app.php | 41 |
1 files changed, 40 insertions, 1 deletions
diff --git a/lib/app.php b/lib/app.php index 4e67da3c414..c2a850b6f6a 100644 --- a/lib/app.php +++ b/lib/app.php @@ -59,7 +59,9 @@ class OC_APP{ // The rest comes here $apps = OC_APPCONFIG::getApps(); foreach( $apps as $app ){ - require( "apps/$app/appinfo/app.php" ); + if( self::isEnabled( $app )){ + require( "apps/$app/appinfo/app.php" ); + } } self::$init = true; @@ -69,6 +71,43 @@ class OC_APP{ } /** + * @brief checks whether or not an app is enabled + * @param $app app + * @returns true/false + * + * This function checks whether or not an app is enabled. + */ + public static function isEnabled( $app ){ + if( 'yes' == OC_APPCONFIG::getValue( $app, 'enabled' )){ + return true; + } + + return false; + } + + /** + * @brief enables an app + * @param $app app + * @returns true/false + * + * This function set an app as enabled in appconfig. + */ + public static function enable( $app ){ + OC_APPCONFIG::setValue( $app, 'enabled', 'yes' ); + } + + /** + * @brief enables an app + * @param $app app + * @returns true/false + * + * This function set an app as enabled in appconfig. + */ + public static function disable( $app ){ + OC_APPCONFIG::setValue( $app, 'enabled', 'no' ); + } + + /** * @brief makes owncloud aware of this app * @param $data array with all information * @returns true/false |