From 2fe646dcec08b36179aa2b6ebca447a20e409b03 Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Wed, 2 May 2012 00:50:26 +0200 Subject: [PATCH] ported the oc_app calls --- apps/admin_dependencies_chk/appinfo/app.php | 4 +- apps/admin_dependencies_chk/settings.php | 2 +- apps/admin_migrate/appinfo/app.php | 2 +- apps/bookmarks/appinfo/app.php | 6 +- apps/bookmarks/index.php | 2 +- apps/calendar/appinfo/app.php | 6 +- apps/calendar/index.php | 2 +- apps/calendar/lib/search.php | 2 +- apps/contacts/ajax/uploadimport.php | 2 +- apps/contacts/appinfo/app.php | 6 +- apps/contacts/import.php | 2 +- apps/contacts/index.php | 2 +- apps/contacts/lib/app.php | 2 +- apps/contacts/lib/search.php | 2 +- apps/contacts/lib/vcard.php | 4 +- apps/external/appinfo/app.php | 6 +- apps/external/index.php | 2 +- apps/files/admin.php | 2 +- apps/files/appinfo/app.php | 4 +- apps/files/index.php | 2 +- apps/files_encryption/appinfo/app.php | 2 +- apps/files_sharing/appinfo/app.php | 2 +- apps/files_sharing/list.php | 2 +- apps/files_versions/appinfo/app.php | 4 +- apps/gallery/appinfo/app.php | 4 +- apps/gallery/index.php | 2 +- apps/media/appinfo/app.php | 6 +- apps/media/index.php | 2 +- apps/remoteStorage/appinfo/app.php | 4 +- apps/user_ldap/appinfo/app.php | 3 +- apps/user_migrate/appinfo/app.php | 4 +- apps/user_openid/appinfo/app.php | 2 +- apps/user_webfinger/appinfo/app.php | 2 +- apps/user_webfinger/webfinger.php | 2 +- lib/public/app.php | 156 ++++++++++++++++++++ 35 files changed, 207 insertions(+), 52 deletions(-) mode change 100644 => 100755 apps/admin_dependencies_chk/appinfo/app.php mode change 100644 => 100755 apps/admin_dependencies_chk/settings.php mode change 100644 => 100755 apps/remoteStorage/appinfo/app.php mode change 100644 => 100755 apps/user_webfinger/appinfo/app.php mode change 100644 => 100755 apps/user_webfinger/webfinger.php create mode 100644 lib/public/app.php diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php old mode 100644 new mode 100755 index f282b103c8..72d368a085 --- a/apps/admin_dependencies_chk/appinfo/app.php +++ b/apps/admin_dependencies_chk/appinfo/app.php @@ -1,9 +1,9 @@ 14, 'id' => 'admin_dependencies_chk', 'name' => 'Owncloud Install Info' )); -OC_APP::registerAdmin('admin_dependencies_chk','settings'); +OCP\App::registerAdmin('admin_dependencies_chk','settings'); diff --git a/apps/admin_dependencies_chk/settings.php b/apps/admin_dependencies_chk/settings.php old mode 100644 new mode 100755 index 0cebc10198..f4915c3d2f --- a/apps/admin_dependencies_chk/settings.php +++ b/apps/admin_dependencies_chk/settings.php @@ -77,7 +77,7 @@ $modules[] =array( foreach($modules as $key => $module) { $enabled = false ; foreach($module['modules'] as $app) { - if(OC_App::isEnabled($app) || $app=='core'){ + if(OCP\App::isEnabled($app) || $app=='core'){ $enabled = true; } } diff --git a/apps/admin_migrate/appinfo/app.php b/apps/admin_migrate/appinfo/app.php index 07672da6da..7a12a32856 100755 --- a/apps/admin_migrate/appinfo/app.php +++ b/apps/admin_migrate/appinfo/app.php @@ -22,7 +22,7 @@ */ -OC_APP::registerAdmin('admin_migrate','settings'); +OCP\App::registerAdmin('admin_migrate','settings'); // add settings page to navigation $entry = array( diff --git a/apps/bookmarks/appinfo/app.php b/apps/bookmarks/appinfo/app.php index 246a0d0ecd..8a8f443891 100755 --- a/apps/bookmarks/appinfo/app.php +++ b/apps/bookmarks/appinfo/app.php @@ -10,12 +10,12 @@ OC::$CLASSPATH['OC_Bookmarks_Bookmarks'] = 'apps/bookmarks/lib/bookmarks.php'; OC::$CLASSPATH['OC_Search_Provider_Bookmarks'] = 'apps/bookmarks/lib/search.php'; -OC_App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); +OCP\App::register( array( 'order' => 70, 'id' => 'bookmark', 'name' => 'Bookmarks' )); $l = new OC_l10n('bookmarks'); -OC_App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); +OCP\App::addNavigationEntry( array( 'id' => 'bookmarks_index', 'order' => 70, 'href' => OCP\Util::linkTo( 'bookmarks', 'index.php' ), 'icon' => OCP\Util::imagePath( 'bookmarks', 'bookmarks.png' ), 'name' => $l->t('Bookmarks'))); -OC_App::registerPersonal('bookmarks', 'settings'); +OCP\App::registerPersonal('bookmarks', 'settings'); OCP\Util::addscript('bookmarks','bookmarksearch'); OC_Search::registerProvider('OC_Search_Provider_Bookmarks'); diff --git a/apps/bookmarks/index.php b/apps/bookmarks/index.php index 7ab74c5f3f..bfac1d2934 100755 --- a/apps/bookmarks/index.php +++ b/apps/bookmarks/index.php @@ -27,7 +27,7 @@ OCP\User::checkLoggedIn(); OC_Util::checkAppEnabled('bookmarks'); -OC_App::setActiveNavigationEntry( 'bookmarks_index' ); +OCP\App::setActiveNavigationEntry( 'bookmarks_index' ); OCP\Util::addscript('bookmarks','bookmarks'); OCP\Util::addStyle('bookmarks', 'bookmarks'); diff --git a/apps/calendar/appinfo/app.php b/apps/calendar/appinfo/app.php index cf1325fad7..7b5db834fb 100755 --- a/apps/calendar/appinfo/app.php +++ b/apps/calendar/appinfo/app.php @@ -11,15 +11,15 @@ OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Calendar_Hooks', 'deleteUser' OCP\Util::addscript('calendar','loader'); OCP\Util::addscript("3rdparty", "chosen/chosen.jquery.min"); OCP\Util::addStyle("3rdparty", "chosen/chosen"); -OC_App::register( array( +OCP\App::register( array( 'order' => 10, 'id' => 'calendar', 'name' => 'Calendar' )); -OC_App::addNavigationEntry( array( +OCP\App::addNavigationEntry( array( 'id' => 'calendar_index', 'order' => 10, 'href' => OCP\Util::linkTo( 'calendar', 'index.php' ), 'icon' => OCP\Util::imagePath( 'calendar', 'icon.svg' ), 'name' => $l->t('Calendar'))); -OC_App::registerPersonal('calendar', 'settings'); +OCP\App::registerPersonal('calendar', 'settings'); OC_Search::registerProvider('OC_Search_Provider_Calendar'); diff --git a/apps/calendar/index.php b/apps/calendar/index.php index 77550420b5..0a77bdbf2b 100755 --- a/apps/calendar/index.php +++ b/apps/calendar/index.php @@ -52,7 +52,7 @@ OCP\Util::addscript('', 'jquery.multiselect'); OCP\Util::addStyle('', 'jquery.multiselect'); OCP\Util::addscript('contacts','jquery.multi-autocomplete'); OCP\Util::addscript('','oc-vcategories'); -OC_App::setActiveNavigationEntry('calendar_index'); +OCP\App::setActiveNavigationEntry('calendar_index'); $tmpl = new OC_Template('calendar', 'calendar', 'user'); $tmpl->assign('eventSources', $eventSources); $tmpl->assign('categories', $categories); diff --git a/apps/calendar/lib/search.php b/apps/calendar/lib/search.php index fae2da3b02..3291e50524 100755 --- a/apps/calendar/lib/search.php +++ b/apps/calendar/lib/search.php @@ -2,7 +2,7 @@ class OC_Search_Provider_Calendar extends OC_Search_Provider{ function search($query){ $calendars = OC_Calendar_Calendar::allCalendars(OCP\USER::getUser(), 1); - if(count($calendars)==0 || !OC_App::isEnabled('calendar')){ + if(count($calendars)==0 || !OCP\App::isEnabled('calendar')){ //return false; } $results=array(); diff --git a/apps/contacts/ajax/uploadimport.php b/apps/contacts/ajax/uploadimport.php index e2bc6d7290..51ae949b68 100755 --- a/apps/contacts/ajax/uploadimport.php +++ b/apps/contacts/ajax/uploadimport.php @@ -34,7 +34,7 @@ function debug($msg) { OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG); } -$view = OC_App::getStorage('contacts'); +$view = OCP\App::getStorage('contacts'); $tmpfile = md5(rand()); // If it is a Drag'n'Drop transfer it's handled here. diff --git a/apps/contacts/appinfo/app.php b/apps/contacts/appinfo/app.php index 87c3695974..4808ea5fa8 100755 --- a/apps/contacts/appinfo/app.php +++ b/apps/contacts/appinfo/app.php @@ -9,12 +9,12 @@ OC_HOOK::connect('OC_User', 'post_deleteUser', 'OC_Contacts_Hooks', 'deleteUser' OC_HOOK::connect('OC_Calendar', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents'); OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources'); -OC_App::register( array( +OCP\App::register( array( 'order' => 10, 'id' => 'contacts', 'name' => 'Contacts' )); -OC_App::addNavigationEntry( array( +OCP\App::addNavigationEntry( array( 'id' => 'contacts_index', 'order' => 10, 'href' => OCP\Util::linkTo( 'contacts', 'index.php' ), @@ -22,6 +22,6 @@ OC_App::addNavigationEntry( array( 'name' => OC_L10N::get('contact')->t('Contacts') )); -OC_APP::registerPersonal('contacts','settings'); +OCP\App::registerPersonal('contacts','settings'); OCP\Util::addscript('contacts', 'loader'); OC_Search::registerProvider('OC_Search_Provider_Contacts'); diff --git a/apps/contacts/import.php b/apps/contacts/import.php index 95f17a8896..9355f8b9f7 100755 --- a/apps/contacts/import.php +++ b/apps/contacts/import.php @@ -19,7 +19,7 @@ if(is_writable('import_tmp/')){ } $view = $file = null; if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') { - $view = OC_App::getStorage('contacts'); + $view = OCP\App::getStorage('contacts'); $file = $view->file_get_contents('/' . $_POST['file']); } else { $file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); diff --git a/apps/contacts/index.php b/apps/contacts/index.php index c018fca764..8e3c2faf01 100755 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -19,7 +19,7 @@ $contacts = OC_Contacts_VCard::all($ids); $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser()); // Load the files we need -OC_App::setActiveNavigationEntry( 'contacts_index' ); +OCP\App::setActiveNavigationEntry( 'contacts_index' ); // Load a specific user? $id = isset( $_GET['id'] ) ? $_GET['id'] : null; diff --git a/apps/contacts/lib/app.php b/apps/contacts/lib/app.php index 4e840026ce..636b9a84b9 100755 --- a/apps/contacts/lib/app.php +++ b/apps/contacts/lib/app.php @@ -53,7 +53,7 @@ class OC_Contacts_App { $vcard = OC_VObject::parse($card['carddata']); // Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly... if(!is_null($vcard) && !$vcard->__isset('N')) { - $appinfo = OC_App::getAppInfo('contacts'); + $appinfo = OCP\App::getAppInfo('contacts'); if($appinfo['version'] >= 5) { OCP\Util::writeLog('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OCP\Util::DEBUG); } diff --git a/apps/contacts/lib/search.php b/apps/contacts/lib/search.php index e2aae58189..144138a7c2 100755 --- a/apps/contacts/lib/search.php +++ b/apps/contacts/lib/search.php @@ -2,7 +2,7 @@ class OC_Search_Provider_Contacts extends OC_Search_Provider{ function search($query){ $addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1); -// if(count($calendars)==0 || !OC_App::isEnabled('contacts')){ +// if(count($calendars)==0 || !OCP\App::isEnabled('contacts')){ // //return false; // } // NOTE: Does the following do anything diff --git a/apps/contacts/lib/vcard.php b/apps/contacts/lib/vcard.php index 45ce1ac3a2..00c008657b 100755 --- a/apps/contacts/lib/vcard.php +++ b/apps/contacts/lib/vcard.php @@ -245,8 +245,8 @@ class OC_Contacts_VCard{ // Add product ID is missing. $prodid = trim($vcard->getAsString('PRODID')); if(!$prodid) { - $appinfo = OC_App::getAppInfo('contacts'); - $appversion = OC_App::getAppVersion('contacts'); + $appinfo = OCP\App::getAppInfo('contacts'); + $appversion = OCP\App::getAppVersion('contacts'); $prodid = '-//ownCloud//NONSGML '.$appinfo['name'].' '.$appversion.'//EN'; $vcard->setString('PRODID', $prodid); } diff --git a/apps/external/appinfo/app.php b/apps/external/appinfo/app.php index 66116ac4c6..b569fc305b 100755 --- a/apps/external/appinfo/app.php +++ b/apps/external/appinfo/app.php @@ -24,12 +24,12 @@ OC::$CLASSPATH['OC_External'] = 'apps/external/lib/external.php'; OCP\Util::addStyle( 'external', 'style'); -OC_APP::registerAdmin('external', 'settings'); +OCP\App::registerAdmin('external', 'settings'); -OC_App::register(array('order' => 70, 'id' => 'external', 'name' => 'External')); +OCP\App::register(array('order' => 70, 'id' => 'external', 'name' => 'External')); $sites = OC_External::getSites(); for ($i = 0; $i < sizeof($sites); $i++) { - OC_App::addNavigationEntry( + OCP\App::addNavigationEntry( array('id' => 'external_index' . ($i + 1), 'order' => 80 + $i, 'href' => OCP\Util::linkTo('external', 'index.php') . '?id=' . ($i + 1), 'icon' => OCP\Util::imagePath('external', 'external.png'), 'name' => $sites[$i][0])); } diff --git a/apps/external/index.php b/apps/external/index.php index 1d4e5cc505..f1f6cbac3c 100755 --- a/apps/external/index.php +++ b/apps/external/index.php @@ -33,7 +33,7 @@ if (isset($_GET['id'])) { $sites = OC_External::getSites(); if (sizeof($sites) >= $id) { $url = $sites[$id - 1][1]; - OC_App::setActiveNavigationEntry('external_index' . $id); + OCP\App::setActiveNavigationEntry('external_index' . $id); $tmpl = new OC_Template('external', 'frame', 'user'); $tmpl->assign('url', $url); diff --git a/apps/files/admin.php b/apps/files/admin.php index 120e245fd4..c14a97568f 100755 --- a/apps/files/admin.php +++ b/apps/files/admin.php @@ -49,7 +49,7 @@ if($_POST) { $maxZipInputSize = OCP\Util::humanFileSize(OC_Config::getValue('maxZipInputSize', OCP\Util::computerFileSize('800 MB'))); $allowZipDownload = intval(OC_Config::getValue('allowZipDownload', true)); -OC_App::setActiveNavigationEntry( "files_administration" ); +OCP\App::setActiveNavigationEntry( "files_administration" ); $tmpl = new OC_Template( 'files', 'admin' ); $tmpl->assign( 'htaccessWorking', $htaccessWorking ); diff --git a/apps/files/appinfo/app.php b/apps/files/appinfo/app.php index 0e82713fe5..4a05a65595 100755 --- a/apps/files/appinfo/app.php +++ b/apps/files/appinfo/app.php @@ -3,8 +3,8 @@ $l=OC_L10N::get('files'); -OC_App::register( array( "order" => 2, "id" => "files", "name" => "Files" )); +OCP\App::register( array( "order" => 2, "id" => "files", "name" => "Files" )); -OC_App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); +OCP\App::addNavigationEntry( array( "id" => "files_index", "order" => 0, "href" => OCP\Util::linkTo( "files", "index.php" ), "icon" => OCP\Util::imagePath( "core", "places/home.svg" ), "name" => $l->t("Files") )); OC_Search::registerProvider('OC_Search_Provider_File'); diff --git a/apps/files/index.php b/apps/files/index.php index 3f97317fc5..86b877115c 100755 --- a/apps/files/index.php +++ b/apps/files/index.php @@ -34,7 +34,7 @@ OCP\Util::addscript( 'files', 'fileactions' ); if(!isset($_SESSION['timezone'])){ OCP\Util::addscript( 'files', 'timezone' ); } -OC_App::setActiveNavigationEntry( "files_index" ); +OCP\App::setActiveNavigationEntry( "files_index" ); // Load the files $dir = isset( $_GET['dir'] ) ? stripslashes($_GET['dir']) : ''; // Redirect if directory does not exist diff --git a/apps/files_encryption/appinfo/app.php b/apps/files_encryption/appinfo/app.php index 98ba4847d2..02fc9dfa26 100755 --- a/apps/files_encryption/appinfo/app.php +++ b/apps/files_encryption/appinfo/app.php @@ -16,4 +16,4 @@ if(!isset($_SESSION['enckey']) and OCP\User::isLoggedIn()){//force the user to r exit(); } -OC_App::registerAdmin('files_encryption', 'settings'); +OCP\App::registerAdmin('files_encryption', 'settings'); diff --git a/apps/files_sharing/appinfo/app.php b/apps/files_sharing/appinfo/app.php index cf7c48d5fb..15f72ef089 100755 --- a/apps/files_sharing/appinfo/app.php +++ b/apps/files_sharing/appinfo/app.php @@ -3,7 +3,7 @@ require_once('apps/files_sharing/sharedstorage.php'); OC::$CLASSPATH['OC_Share'] = "apps/files_sharing/lib_share.php"; -OC_APP::registerAdmin('files_sharing', 'settings'); +OCP\App::registerAdmin('files_sharing', 'settings'); OC_Hook::connect("OC_Filesystem", "post_delete", "OC_Share", "deleteItem"); OC_Hook::connect("OC_Filesystem", "post_rename", "OC_Share", "renameItem"); OC_Hook::connect("OC_Filesystem", "post_write", "OC_Share", "updateItem"); diff --git a/apps/files_sharing/list.php b/apps/files_sharing/list.php index e607348a03..eb1ed8a186 100755 --- a/apps/files_sharing/list.php +++ b/apps/files_sharing/list.php @@ -26,7 +26,7 @@ require_once('lib_share.php'); OCP\User::checkLoggedIn(); OC_Util::checkAppEnabled('files_sharing'); -OC_App::setActiveNavigationEntry("files_sharing_list"); +OCP\App::setActiveNavigationEntry("files_sharing_list"); OCP\Util::addscript("files_sharing", "list"); diff --git a/apps/files_versions/appinfo/app.php b/apps/files_versions/appinfo/app.php index 385f2922d9..ebaa7ee0e7 100755 --- a/apps/files_versions/appinfo/app.php +++ b/apps/files_versions/appinfo/app.php @@ -3,12 +3,12 @@ require_once('apps/files_versions/versions.php'); // Add an entry in the app list -OC_App::register( array( +OCP\App::register( array( 'order' => 10, 'id' => 'files_versions', 'name' => 'Versioning' )); -OC_APP::registerAdmin('files_versions', 'settings'); +OCP\App::registerAdmin('files_versions', 'settings'); OCP\Util::addscript('files_versions', 'versions'); // Listen to write signals diff --git a/apps/gallery/appinfo/app.php b/apps/gallery/appinfo/app.php index ad4723c142..e6305a76b7 100755 --- a/apps/gallery/appinfo/app.php +++ b/apps/gallery/appinfo/app.php @@ -29,12 +29,12 @@ OC::$CLASSPATH['OC_Gallery_Hooks_Handlers'] = 'apps/gallery/lib/hooks_handlers.p $l = OC_L10N::get('gallery'); -OC_App::register(array( +OCP\App::register(array( 'order' => 20, 'id' => 'gallery', 'name' => 'Pictures')); -OC_App::addNavigationEntry( array( +OCP\App::addNavigationEntry( array( 'id' => 'gallery_index', 'order' => 20, 'href' => OCP\Util::linkTo('gallery', 'index.php'), diff --git a/apps/gallery/index.php b/apps/gallery/index.php index 1d7fc1aee7..0ae6b15d76 100755 --- a/apps/gallery/index.php +++ b/apps/gallery/index.php @@ -25,7 +25,7 @@ OCP\User::checkLoggedIn(); OC_Util::checkAppEnabled('gallery'); -OC_App::setActiveNavigationEntry( 'gallery_index' ); +OCP\App::setActiveNavigationEntry( 'gallery_index' ); if (!file_exists(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery')) { mkdir(OC_Config::getValue("datadirectory").'/'. OCP\USER::getUser() .'/gallery'); diff --git a/apps/media/appinfo/app.php b/apps/media/appinfo/app.php index 5e7a411f67..26cb204554 100755 --- a/apps/media/appinfo/app.php +++ b/apps/media/appinfo/app.php @@ -25,10 +25,10 @@ $l=OC_L10N::get('media'); require_once('apps/media/lib_media.php'); OCP\Util::addscript('media','loader'); -OC_APP::registerPersonal('media','settings'); +OCP\App::registerPersonal('media','settings'); -OC_App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); +OCP\App::register( array( 'order' => 3, 'id' => 'media', 'name' => 'Media' )); -OC_App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music'))); +OCP\App::addNavigationEntry(array('id' => 'media_index', 'order' => 2, 'href' => OCP\Util::linkTo('media', 'index.php'), 'icon' => OCP\Util::imagePath('core', 'places/music.svg'), 'name' => $l->t('Music'))); OC_Search::registerProvider('OC_MediaSearchProvider'); diff --git a/apps/media/index.php b/apps/media/index.php index 0d226cb0ca..df597c3108 100755 --- a/apps/media/index.php +++ b/apps/media/index.php @@ -39,7 +39,7 @@ OCP\Util::addscript('media','scanner'); OCP\Util::addscript('media','jquery.jplayer.min'); OCP\Util::addStyle('media','music'); -OC_App::setActiveNavigationEntry( 'media_index' ); +OCP\App::setActiveNavigationEntry( 'media_index' ); $tmpl = new OC_Template( 'media', 'music', 'user' ); $tmpl->printPage(); diff --git a/apps/remoteStorage/appinfo/app.php b/apps/remoteStorage/appinfo/app.php old mode 100644 new mode 100755 index a1fbebc42f..14b8a3d11d --- a/apps/remoteStorage/appinfo/app.php +++ b/apps/remoteStorage/appinfo/app.php @@ -1,6 +1,6 @@ 10, 'id' => 'remoteStorage', 'name' => 'remoteStorage compatibility' )); -OC_APP::registerPersonal('remoteStorage','settings'); +OCP\App::registerPersonal('remoteStorage','settings'); diff --git a/apps/user_ldap/appinfo/app.php b/apps/user_ldap/appinfo/app.php index 0fec108484..79675f940b 100755 --- a/apps/user_ldap/appinfo/app.php +++ b/apps/user_ldap/appinfo/app.php @@ -25,7 +25,7 @@ require_once('apps/user_ldap/lib_ldap.php'); require_once('apps/user_ldap/user_ldap.php'); require_once('apps/user_ldap/group_ldap.php'); -OC_APP::registerAdmin('user_ldap','settings'); +OCP\App::registerAdmin('user_ldap','settings'); // define LDAP_DEFAULT_PORT define('OC_USER_BACKEND_LDAP_DEFAULT_PORT', 389); @@ -44,4 +44,3 @@ $entry = array( 'href' => OCP\Util::linkTo( 'user_ldap', 'settings.php' ), 'name' => 'LDAP' ); -// OC_App::addNavigationSubEntry( "core_users", $entry); diff --git a/apps/user_migrate/appinfo/app.php b/apps/user_migrate/appinfo/app.php index 0e9f69fbed..e57bfc2a9d 100755 --- a/apps/user_migrate/appinfo/app.php +++ b/apps/user_migrate/appinfo/app.php @@ -21,8 +21,8 @@ * */ -OC_APP::registerPersonal( 'user_migrate', 'settings' ); -OC_APP::registerAdmin( 'user_migrate', 'admin' ); +OCP\App::registerPersonal( 'user_migrate', 'settings' ); +OCP\App::registerAdmin( 'user_migrate', 'admin' ); OCP\Util::addscript( 'user_migrate', 'export'); // add settings page to navigation diff --git a/apps/user_openid/appinfo/app.php b/apps/user_openid/appinfo/app.php index b77067758b..c683254101 100755 --- a/apps/user_openid/appinfo/app.php +++ b/apps/user_openid/appinfo/app.php @@ -17,7 +17,7 @@ if(strpos($_SERVER["REQUEST_URI"],'?') and !strpos($_SERVER["REQUEST_URI"],'=')) OCP\Util::addHeader('link',array('rel'=>'openid.server', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName)); OCP\Util::addHeader('link',array('rel'=>'openid.delegate', 'href'=>OCP\Util::linkToAbsolute( "user_openid", "user.php" ).'/'.$userName)); -OC_APP::registerPersonal('user_openid','settings'); +OCP\App::registerPersonal('user_openid','settings'); require_once 'apps/user_openid/user_openid.php'; diff --git a/apps/user_webfinger/appinfo/app.php b/apps/user_webfinger/appinfo/app.php old mode 100644 new mode 100755 index 8e8f92c965..f7b927df82 --- a/apps/user_webfinger/appinfo/app.php +++ b/apps/user_webfinger/appinfo/app.php @@ -1,5 +1,5 @@ 11, 'id' => 'user_webfinger', 'name' => 'Webfinger' )); diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php old mode 100644 new mode 100755 index 51686111bf..da35cf29d0 --- a/apps/user_webfinger/webfinger.php +++ b/apps/user_webfinger/webfinger.php @@ -61,7 +61,7 @@ echo "<"; . +* +*/ + +/** + * Public interface of ownCloud for apps to use. + * App Class. + * + */ + +// use OCP namespace for all classes that are considered public. +// This means that they should be used by apps instead of the internal ownCloud classes +namespace OCP; + +class App { + + + /** + * @brief get the user id of the user currently logged in. + * @return string uid or false + */ + public static function getUser(){ + return \OC_USER::getUser(); + } + + /** + * @brief makes owncloud aware of this app + * @param $data array with all information + * @returns true/false + * + * This function registers the application. $data is an associative array. + * The following keys are required: + * - id: id of the application, has to be unique ('addressbook') + * - name: Human readable name ('Addressbook') + * - version: array with Version (major, minor, bugfix) ( array(1, 0, 2)) + * + * The following keys are optional: + * - order: integer, that influences the position of your application in + * a list of applications. Lower values come first. + * + */ + public static function register( $data ){ + return \OC_App::register( $data ); + } + + + + /** + * register an admin form to be shown + */ + public static function registerAdmin($app,$page){ + return \OC_App::registerAdmin($app,$page); + } + + + /** + * @brief adds an entry to the navigation + * @param $data array containing the data + * @returns true/false + * + * This function adds a new entry to the navigation visible to users. $data + * is an associative array. + * The following keys are required: + * - id: unique id for this entry ('addressbook_index') + * - href: link to the page + * - name: Human readable name ('Addressbook') + * + * The following keys are optional: + * - icon: path to the icon of the app + * - order: integer, that influences the position of your application in + * the navigation. Lower values come first. + */ + public static function addNavigationEntry( $data ){ + return \OC_App::addNavigationEntry($data); + } + + /** + * @brief Read app metadata from the info.xml file + * @param string $appid id of the app or the path of the info.xml file + * @param boolean path (optional) + * @returns array + */ + public static function getAppInfo($appid,$path=false){ + return \OC_App::getAppInfo($appid,$path); + } + + /** + * register a personal form to be shown + */ + public static function registerPersonal($app,$page){ + return \OC_App::registerPersonal($app,$page); + } + + + /** + * @brief marks a navigation entry as active + * @param $id id of the entry + * @returns true/false + * + * This function sets a navigation entry as active and removes the 'active' + * property from all other entries. The templates can use this for + * highlighting the current position of the user. + */ + public static function setActiveNavigationEntry($id){ + return \OC_App::setActiveNavigationEntry($id); + } + + /** + * @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 ){ + return \OC_App::isEnabled( $app ); + } + + /** + * get the last version of the app, either from appinfo/version or from appinfo/info.xml + */ + public static function getAppVersion($appid){ + return \OC_App::getAppVersion( $appid ); + } + + /** + * @param string appid + * @return OC_FilesystemView + */ + public static function getStorage($appid){ + return \OC_App::getStorage( $appid ); + } + + +} + + +?>