diff options
author | Robin Appelman <icewind1991@gmail.com> | 2011-08-08 23:32:54 +0200 |
---|---|---|
committer | Robin Appelman <icewind1991@gmail.com> | 2011-08-08 23:46:52 +0200 |
commit | 7b38e5d7c73cb29a5b57bb36b9f22ce2672cb325 (patch) | |
tree | 132b282b41ab4ac2c2374b455255b8514b6b000c /lib | |
parent | 82d2c45e14e5089defef8712dafa0fe97e16f8e0 (diff) | |
download | nextcloud-server-7b38e5d7c73cb29a5b57bb36b9f22ce2672cb325.tar.gz nextcloud-server-7b38e5d7c73cb29a5b57bb36b9f22ce2672cb325.zip |
apps can now add their own forms to the Personal page
Diffstat (limited to 'lib')
-rw-r--r-- | lib/app.php | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/lib/app.php b/lib/app.php index 51e86c847dd..f1363c8af5a 100644 --- a/lib/app.php +++ b/lib/app.php @@ -31,6 +31,9 @@ class OC_App{ static private $apps = array(); static private $activeapp = ''; static private $navigation = array(); + static private $settingsForms = array(); + static private $adminForms = array(); + static private $personalForms = array(); /** * @brief loads all apps @@ -284,4 +287,48 @@ class OC_App{ return $topFolder; } } + + + /** + * get the forms for either settings, admin or personal + */ + public static function getForms($type){ + $forms=array(); + switch($type){ + case 'settings': + $source=self::$settingsForms; + break; + case 'admin': + $source=self::$adminForms; + break; + case 'personal': + $source=self::$personalForms; + break; + } + foreach($source as $form){ + $forms[]=include $form; + } + return $forms; + } + + /** + * register a settings form to be shown + */ + public static function registerSettings($app,$page){ + self::$settingsForms[]='apps/'.$app.'/'.$page.'.php'; + } + + /** + * register an admin form to be shown + */ + public static function registerAdmin($app,$page){ + self::$adminForms[]='apps/'.$app.'/'.$page.'.php'; + } + + /** + * register a personal form to be shown + */ + public static function registerPersonal($app,$page){ + self::$personalForms[]='apps/'.$app.'/'.$page.'.php'; + } } |