Ejemplo n.º 1
0
 /**
  * @NoAdminRequired
  * @NoCSRFRequired
  * 
  * @CORS
  */
 public function contact($id)
 {
     $app = new Application();
     $c = $app->getContainer();
     $contactsController = $c->query('ContactsController');
     return $contactsController->ApiContactData($id);
     //test http://{owncloudomain}/ocs/v1.php/apps/contactsplus/api/v1/contact/283
     /*
     		 $contact = VCard::find($id);
     		 if(!is_null($contact['carddata'])){
     		 	$vcard = VObject\Reader::read($contact['carddata']);
     		 	$details = VCard::structureContact($vcard);
     		
     			 $addrInfo = AddressBook::find($contact['addressbookid']);
     			 $details['addressbook'] = $addrInfo['displayname'];
     			 $details['addressbookuri'] = $addrInfo['uri'];
     		  }
     		 
     		 return $details;*/
 }
Ejemplo n.º 2
0
// add an navigation entr
$navigationEntry = function () use($c) {
    return ['id' => $c->getAppName(), 'order' => 1, 'name' => $c->query('L10N')->t('Contacts+'), 'href' => $c->query('URLGenerator')->linkToRoute($c->getAppName() . '.page.index'), 'icon' => $c->query('URLGenerator')->imagePath($c->getAppName(), 'contacts.svg')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
if (\OCP\User::isLoggedIn()) {
    \OCP\Util::addScript('contactsplus', 'search');
}
\OC::$server->getSearch()->registerProvider('OCA\\ContactsPlus\\Search\\Provider', array('app' => $contactsAppName));
\OCP\Share::registerBackend(ContactsApp::SHAREADDRESSBOOK, 'OCA\\ContactsPlus\\Share\\Backend\\Addressbook');
\OCP\Share::registerBackend(ContactsApp::SHARECONTACT, 'OCA\\ContactsPlus\\Share\\Backend\\Contact');
\OCP\Util::connectHook('OC_User', 'post_deleteUser', '\\OCA\\ContactsPlus\\Hooks', 'deleteUser');
if (\OCP\User::isLoggedIn() && !\OCP\App::isEnabled('contacts')) {
    $request = $c->query('Request');
    if (isset($request->server['REQUEST_URI'])) {
        $url = $request->server['REQUEST_URI'];
        if (preg_match('%index.php/apps/files(/.*)?%', $url) || preg_match('%index.php/s/(/.*)?%', $url)) {
            \OCP\Util::addscript($contactsAppName, 'loader');
        }
    }
}
if (\OCP\User::isLoggedIn()) {
    $cm = \OC::$server->getContactsManager();
    $cm->register(function () use($cm) {
        $myApp = new Application();
        $addressBooks = $myApp->getContainer()->query('AddressbookController')->getAddressBooksForCM();
        foreach ($addressBooks as $addressBook) {
            $cm->registerAddressBook(new AddressbookProvider($addressBook));
        }
    });
}
Ejemplo n.º 3
0
<?php

use OCA\ContactsPlus\AppInfo\Application;
$application = new Application();
$application->registerRoutes($this, ['routes' => [['name' => 'page#index', 'url' => '/', 'verb' => 'GET'], ['name' => 'photo#getImageFromCloud', 'url' => '/getimagefromcloud', 'verb' => 'GET'], ['name' => 'photo#cropPhoto', 'url' => '/cropphoto', 'verb' => 'POST'], ['name' => 'photo#saveCropPhotoContact', 'url' => '/savecropphotocontact', 'verb' => 'POST'], ['name' => 'photo#uploadPhoto', 'url' => '/uploadphoto', 'verb' => 'POST'], ['name' => 'photo#deletePhoto', 'url' => '/deletephoto', 'verb' => 'GET'], ['name' => 'photo#clearPhotoCache', 'url' => '/clearphotocache', 'verb' => 'POST'], ['name' => 'contacts#getNewFormContact', 'url' => '/getnewformcontact', 'verb' => 'POST'], ['name' => 'contacts#newContactSave', 'url' => '/newcontactsave', 'verb' => 'POST'], ['name' => 'contacts#getEditFormContact', 'url' => '/geteditformcontact', 'verb' => 'POST'], ['name' => 'contacts#editContactSave', 'url' => '/editcontactsave', 'verb' => 'POST'], ['name' => 'contacts#showContact', 'url' => '/showcontact', 'verb' => 'POST'], ['name' => 'contacts#deleteContact', 'url' => '/deletecontact', 'verb' => 'POST'], ['name' => 'contacts#deleteContactFromGroup', 'url' => '/deletecontactfromgroup', 'verb' => 'POST'], ['name' => 'contacts#addProbertyToContact', 'url' => '/addprobertytocontact', 'verb' => 'POST'], ['name' => 'contacts#copyContact', 'url' => '/copycontact', 'verb' => 'POST'], ['name' => 'contacts#moveContact', 'url' => '/movecontact', 'verb' => 'POST'], ['name' => 'contacts#getContactCards', 'url' => '/getcontactcards', 'verb' => 'POST'], ['name' => 'export#exportContacts', 'url' => '/exportcontacts', 'verb' => 'GET'], ['name' => 'export#exportBirthdays', 'url' => '/exportbirthdays', 'verb' => 'GET'], ['name' => 'import#getImportDialogTpl', 'url' => '/getimportdialogtplcontacts', 'verb' => 'POST'], ['name' => 'import#checkAddressbookExists', 'url' => '/checkaddressbookexists', 'verb' => 'POST'], ['name' => 'import#importVcards', 'url' => '/importvcards', 'verb' => 'POST'], ['name' => 'addressbook#getAddressBooks', 'url' => '/getaddressbooks', 'verb' => 'GET'], ['name' => 'addressbook#add', 'url' => '/addaddrbook', 'verb' => 'POST'], ['name' => 'addressbook#update', 'url' => '/updateaddrbook', 'verb' => 'POST'], ['name' => 'addressbook#delete', 'url' => '/deleteaddrbook', 'verb' => 'POST'], ['name' => 'addressbook#activate', 'url' => '/activateaddrbook', 'verb' => 'POST'], ['name' => 'addressbook#getCategories', 'url' => '/getcategoriesaddrbook', 'verb' => 'POST'], ['name' => 'addressbook#addIosGroupsSupport', 'url' => '/addiosgroupssupport', 'verb' => 'POST'], ['name' => 'addressbook#prepareIosGroups', 'url' => '/prepareiosgroups', 'verb' => 'POST'], ['name' => 'addressbook#saveSortOrderGroups', 'url' => '/savesortordergroups', 'verb' => 'POST']]]);
\OCP\API::register('get', '/apps/kontakte/api/v1/shares', array('\\OCA\\ContactsPlus\\API\\Local', 'getAllShares'), 'contactsplus');
\OCP\API::register('get', '/apps/kontakte/api/v1/shares/{id}', array('\\OCA\\ContactsPlus\\API\\Local', 'getShare'), 'contactsplus');
Ejemplo n.º 4
0
<?php

namespace OCA\ContactsPlus\AppInfo;

use OCA\ContactsPlus\App as ContactsApp;
$app = new Application();
$c = $app->getContainer();
$contactsAppName = 'contactsplus';
// add an navigation entr
$navigationEntry = function () use($c) {
    return ['id' => $c->getAppName(), 'order' => 1, 'name' => $c->query('L10N')->t('Contacts+'), 'href' => $c->query('URLGenerator')->linkToRoute($c->getAppName() . '.page.index'), 'icon' => $c->query('URLGenerator')->imagePath($c->getAppName(), 'contacts.svg')];
};
$c->getServer()->getNavigationManager()->add($navigationEntry);
\OC::$server->getSearch()->registerProvider('OCA\\ContactsPlus\\Search\\Provider', array('app' => $contactsAppName));
\OCP\Share::registerBackend(ContactsApp::SHAREADDRESSBOOK, 'OCA\\ContactsPlus\\Share\\Backend\\Addressbook');
\OCP\Share::registerBackend(ContactsApp::SHARECONTACT, 'OCA\\ContactsPlus\\Share\\Backend\\Contact');
\OCP\Util::connectHook('\\OCA\\CalendarPlus', 'getSources', 'OCA\\ContactsPlus\\Hooks', 'getCalenderSources');
\OCP\Util::connectHook('OCA\\CalendarPlus', 'getCalendars', 'OCA\\ContactsPlus\\Hooks', 'getBirthdayCalender');
\OCP\Util::connectHook('OCA\\CalendarPlus', 'getEvents', 'OCA\\ContactsPlus\\Hooks', 'getBirthdayEvents');
\OCP\Util::connectHook('OC_User', 'post_deleteUser', '\\OCA\\ContactsPlus\\Hooks', 'deleteUser');
if (\OCP\User::isLoggedIn() && !\OCP\App::isEnabled('contacts')) {
    $request = $c->query('Request');
    if (isset($request->server['REQUEST_URI'])) {
        $url = $request->server['REQUEST_URI'];
        if (preg_match('%index.php/apps/files(/.*)?%', $url) || preg_match('%index.php/s/(/.*)?%', $url)) {
            \OCP\Util::addscript($contactsAppName, 'loader');
        }
    }
}