Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrank Karlitschek <frank@owncloud.org>2012-05-02 02:50:26 +0400
committerFrank Karlitschek <frank@owncloud.org>2012-05-02 02:50:26 +0400
commit2fe646dcec08b36179aa2b6ebca447a20e409b03 (patch)
treee5b909e88d9271e3301c9db3fea8771d059a914d
parentc94f39b488f9ae6bd24cbdbb5cfa877e29f199e3 (diff)
ported the oc_app calls
-rwxr-xr-x[-rw-r--r--]apps/admin_dependencies_chk/appinfo/app.php4
-rwxr-xr-x[-rw-r--r--]apps/admin_dependencies_chk/settings.php2
-rwxr-xr-xapps/admin_migrate/appinfo/app.php2
-rwxr-xr-xapps/bookmarks/appinfo/app.php6
-rwxr-xr-xapps/bookmarks/index.php2
-rwxr-xr-xapps/calendar/appinfo/app.php6
-rwxr-xr-xapps/calendar/index.php2
-rwxr-xr-xapps/calendar/lib/search.php2
-rwxr-xr-xapps/contacts/ajax/uploadimport.php2
-rwxr-xr-xapps/contacts/appinfo/app.php6
-rwxr-xr-xapps/contacts/import.php2
-rwxr-xr-xapps/contacts/index.php2
-rwxr-xr-xapps/contacts/lib/app.php2
-rwxr-xr-xapps/contacts/lib/search.php2
-rwxr-xr-xapps/contacts/lib/vcard.php4
-rwxr-xr-xapps/external/appinfo/app.php6
-rwxr-xr-xapps/external/index.php2
-rwxr-xr-xapps/files/admin.php2
-rwxr-xr-xapps/files/appinfo/app.php4
-rwxr-xr-xapps/files/index.php2
-rwxr-xr-xapps/files_encryption/appinfo/app.php2
-rwxr-xr-xapps/files_sharing/appinfo/app.php2
-rwxr-xr-xapps/files_sharing/list.php2
-rwxr-xr-xapps/files_versions/appinfo/app.php4
-rwxr-xr-xapps/gallery/appinfo/app.php4
-rwxr-xr-xapps/gallery/index.php2
-rwxr-xr-xapps/media/appinfo/app.php6
-rwxr-xr-xapps/media/index.php2
-rwxr-xr-x[-rw-r--r--]apps/remoteStorage/appinfo/app.php4
-rwxr-xr-xapps/user_ldap/appinfo/app.php3
-rwxr-xr-xapps/user_migrate/appinfo/app.php4
-rwxr-xr-xapps/user_openid/appinfo/app.php2
-rwxr-xr-x[-rw-r--r--]apps/user_webfinger/appinfo/app.php2
-rwxr-xr-x[-rw-r--r--]apps/user_webfinger/webfinger.php2
-rw-r--r--lib/public/app.php156
35 files changed, 207 insertions, 52 deletions
diff --git a/apps/admin_dependencies_chk/appinfo/app.php b/apps/admin_dependencies_chk/appinfo/app.php
index f282b103c87..72d368a085e 100644..100755
--- a/apps/admin_dependencies_chk/appinfo/app.php
+++ b/apps/admin_dependencies_chk/appinfo/app.php
@@ -1,9 +1,9 @@
<?php
$l=OC_L10N::get('admin_dependencies_chk');
-OC_App::register( array(
+OCP\App::register( array(
'order' => 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
index 0cebc10198f..f4915c3d2fe 100644..100755
--- 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 07672da6dae..7a12a32856d 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 246a0d0ecd7..8a8f443891c 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 7ab74c5f3f3..bfac1d29343 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 cf1325fad7a..7b5db834fb5 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 77550420b53..0a77bdbf2ba 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 fae2da3b029..3291e505249 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 e2bc6d7290b..51ae949b680 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 87c36959743..4808ea5fa83 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 95f17a8896f..9355f8b9f70 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 c018fca764a..8e3c2faf012 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 4e840026ce3..636b9a84b9d 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 e2aae58189b..144138a7c2c 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 45ce1ac3a2c..00c008657b7 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 66116ac4c6e..b569fc305ba 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 1d4e5cc5051..f1f6cbac3cf 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 120e245fd42..c14a97568f0 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 0e82713fe5c..4a05a655957 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 3f97317fc5f..86b877115ca 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 98ba4847d27..02fc9dfa267 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 cf7c48d5fb9..15f72ef0895 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 e607348a037..eb1ed8a186f 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 385f2922d9f..ebaa7ee0e7e 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 ad4723c1425..e6305a76b75 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 1d7fc1aee74..0ae6b15d763 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 5e7a411f677..26cb2045549 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 0d226cb0ca1..df597c31085 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
index a1fbebc42f5..14b8a3d11df 100644..100755
--- a/apps/remoteStorage/appinfo/app.php
+++ b/apps/remoteStorage/appinfo/app.php
@@ -1,6 +1,6 @@
<?php
-OC_App::register( array(
+OCP\App::register( array(
'order' => 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 0fec1084848..79675f940bc 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 0e9f69fbed5..e57bfc2a9d3 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 b77067758b3..c683254101f 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
index 8e8f92c9657..f7b927df82a 100644..100755
--- a/apps/user_webfinger/appinfo/app.php
+++ b/apps/user_webfinger/appinfo/app.php
@@ -1,5 +1,5 @@
<?php
-OC_App::register( array(
+OCP\App::register( array(
'order' => 11,
'id' => 'user_webfinger',
'name' => 'Webfinger' ));
diff --git a/apps/user_webfinger/webfinger.php b/apps/user_webfinger/webfinger.php
index 51686111bf7..da35cf29d0e 100644..100755
--- a/apps/user_webfinger/webfinger.php
+++ b/apps/user_webfinger/webfinger.php
@@ -61,7 +61,7 @@ echo "<";
<?php
$apps = OC_Appconfig::getApps();
foreach($apps as $app) {
- if(OC_App::isEnabled($app)) {
+ if(OCP\App::isEnabled($app)) {
if(is_file(OC::$APPSROOT . '/apps/' . $app . '/appinfo/webfinger.php')) {
require($app . '/appinfo/webfinger.php');
}
diff --git a/lib/public/app.php b/lib/public/app.php
new file mode 100644
index 00000000000..70894c3648d
--- /dev/null
+++ b/lib/public/app.php
@@ -0,0 +1,156 @@
+<?php
+/**
+* ownCloud
+*
+* @author Frank Karlitschek
+* @copyright 2010 Frank Karlitschek karlitschek@kde.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/>.
+*
+*/
+
+/**
+ * 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 );
+ }
+
+
+}
+
+
+?>