1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-10 21:24:33 +01:00

ported the oc_app calls

This commit is contained in:
Frank Karlitschek 2012-05-02 00:50:26 +02:00
parent fe55806527
commit b2f19f3a7f
7 changed files with 10 additions and 10 deletions

View File

@ -34,7 +34,7 @@ function debug($msg) {
OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG); OCP\Util::writeLog('contacts','ajax/uploadimport.php: '.$msg, OCP\Util::DEBUG);
} }
$view = OC_App::getStorage('contacts'); $view = OCP\App::getStorage('contacts');
$tmpfile = md5(rand()); $tmpfile = md5(rand());
// If it is a Drag'n'Drop transfer it's handled here. // If it is a Drag'n'Drop transfer it's handled here.

View File

@ -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', 'getEvents', 'OC_Contacts_Hooks', 'getBirthdayEvents');
OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources'); OC_HOOK::connect('OC_Calendar', 'getSources', 'OC_Contacts_Hooks', 'getCalenderSources');
OC_App::register( array( OCP\App::register( array(
'order' => 10, 'order' => 10,
'id' => 'contacts', 'id' => 'contacts',
'name' => 'Contacts' )); 'name' => 'Contacts' ));
OC_App::addNavigationEntry( array( OCP\App::addNavigationEntry( array(
'id' => 'contacts_index', 'id' => 'contacts_index',
'order' => 10, 'order' => 10,
'href' => OCP\Util::linkTo( 'contacts', 'index.php' ), 'href' => OCP\Util::linkTo( 'contacts', 'index.php' ),
@ -22,6 +22,6 @@ OC_App::addNavigationEntry( array(
'name' => OC_L10N::get('contact')->t('Contacts') )); 'name' => OC_L10N::get('contact')->t('Contacts') ));
OC_APP::registerPersonal('contacts','settings'); OCP\App::registerPersonal('contacts','settings');
OCP\Util::addscript('contacts', 'loader'); OCP\Util::addscript('contacts', 'loader');
OC_Search::registerProvider('OC_Search_Provider_Contacts'); OC_Search::registerProvider('OC_Search_Provider_Contacts');

View File

@ -19,7 +19,7 @@ if(is_writable('import_tmp/')){
} }
$view = $file = null; $view = $file = null;
if(isset($_POST['fstype']) && $_POST['fstype'] == 'OC_FilesystemView') { 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']); $file = $view->file_get_contents('/' . $_POST['file']);
} else { } else {
$file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']); $file = OC_Filesystem::file_get_contents($_POST['path'] . '/' . $_POST['file']);

View File

@ -19,7 +19,7 @@ $contacts = OC_Contacts_VCard::all($ids);
$addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser()); $addressbooks = OC_Contacts_Addressbook::active(OCP\USER::getUser());
// Load the files we need // Load the files we need
OC_App::setActiveNavigationEntry( 'contacts_index' ); OCP\App::setActiveNavigationEntry( 'contacts_index' );
// Load a specific user? // Load a specific user?
$id = isset( $_GET['id'] ) ? $_GET['id'] : null; $id = isset( $_GET['id'] ) ? $_GET['id'] : null;

View File

@ -53,7 +53,7 @@ class OC_Contacts_App {
$vcard = OC_VObject::parse($card['carddata']); $vcard = OC_VObject::parse($card['carddata']);
// Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly... // Try to fix cards with missing 'N' field from pre ownCloud 4. Hot damn, this is ugly...
if(!is_null($vcard) && !$vcard->__isset('N')) { if(!is_null($vcard) && !$vcard->__isset('N')) {
$appinfo = OC_App::getAppInfo('contacts'); $appinfo = OCP\App::getAppInfo('contacts');
if($appinfo['version'] >= 5) { if($appinfo['version'] >= 5) {
OCP\Util::writeLog('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OCP\Util::DEBUG); OCP\Util::writeLog('contacts','OC_Contacts_App::getContactVCard. Deprecated check for missing N field', OCP\Util::DEBUG);
} }

View File

@ -2,7 +2,7 @@
class OC_Search_Provider_Contacts extends OC_Search_Provider{ class OC_Search_Provider_Contacts extends OC_Search_Provider{
function search($query){ function search($query){
$addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser(), 1); $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; // //return false;
// } // }
// NOTE: Does the following do anything // NOTE: Does the following do anything

View File

@ -245,8 +245,8 @@ class OC_Contacts_VCard{
// Add product ID is missing. // Add product ID is missing.
$prodid = trim($vcard->getAsString('PRODID')); $prodid = trim($vcard->getAsString('PRODID'));
if(!$prodid) { if(!$prodid) {
$appinfo = OC_App::getAppInfo('contacts'); $appinfo = OCP\App::getAppInfo('contacts');
$appversion = OC_App::getAppVersion('contacts'); $appversion = OCP\App::getAppVersion('contacts');
$prodid = '-//ownCloud//NONSGML '.$appinfo['name'].' '.$appversion.'//EN'; $prodid = '-//ownCloud//NONSGML '.$appinfo['name'].' '.$appversion.'//EN';
$vcard->setString('PRODID', $prodid); $vcard->setString('PRODID', $prodid);
} }