editaddress.php 813 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. /**
  3. * Copyright (c) 2011 Thomas Tanghus <thomas@tanghus.net>
  4. * This file is licensed under the Affero General Public License version 3 or
  5. * later.
  6. * See the COPYING-README file.
  7. */
  8. OCP\JSON::checkLoggedIn();
  9. OCP\JSON::checkAppEnabled('contacts');
  10. $id = $_GET['id'];
  11. $checksum = isset($_GET['checksum'])?$_GET['checksum']:'';
  12. $vcard = OC_Contacts_App::getContactVCard($id);
  13. $adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
  14. $tmpl = new OCP\Template("contacts", "part.edit_address_dialog");
  15. if($checksum) {
  16. $line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
  17. $element = $vcard->children[$line];
  18. $adr = OC_Contacts_VCard::structureProperty($element);
  19. $tmpl->assign('adr',$adr);
  20. }
  21. $tmpl->assign('id',$id);
  22. $tmpl->assign('adr_types',$adr_types);
  23. $tmpl->printpage();
  24. ?>