diff options
author | Thomas Tanghus <thomas@tanghus.net> | 2012-06-17 20:22:01 +0200 |
---|---|---|
committer | Thomas Tanghus <thomas@tanghus.net> | 2012-06-17 20:25:32 +0200 |
commit | b6b6d691582a22437b4f96e1c9f5915635dc4815 (patch) | |
tree | 030ea8887648cfa82564d993a8587338e7a56f71 /apps/contacts/templates | |
parent | 2875901fc7c2eadb95deb6efb23d725dae35be02 (diff) | |
download | nextcloud-server-b6b6d691582a22437b4f96e1c9f5915635dc4815.tar.gz nextcloud-server-b6b6d691582a22437b4f96e1c9f5915635dc4815.zip |
Moved parsing to the controller and js to contacts.js.
Diffstat (limited to 'apps/contacts/templates')
-rw-r--r-- | apps/contacts/templates/part.contacts.php | 32 |
1 files changed, 7 insertions, 25 deletions
diff --git a/apps/contacts/templates/part.contacts.php b/apps/contacts/templates/part.contacts.php index 6c1252debce..d23a249b981 100644 --- a/apps/contacts/templates/part.contacts.php +++ b/apps/contacts/templates/part.contacts.php @@ -1,28 +1,10 @@ <?php -foreach($_['contacts'] as $category => $contacts): - echo '<h3 class="addressbookname">'.$category.'</h3>'; - echo '<div>'; - echo '<ul class="contacts">'; - foreach($contacts as $contact): - $display = trim($contact['fullname']); - if(!$display) { - $vcard = OC_Contacts_App::getContactVCard($contact['id']); - if(!is_null($vcard)) { - $struct = OC_Contacts_VCard::structureContact($vcard); - $display = isset($struct['EMAIL'][0])?$struct['EMAIL'][0]['value']:'[UNKNOWN]'; - } - } - echo '<li role="button" book-id="'.$contact['addressbookid'].'" data-id="'.$contact['id'].'"><a href="index.php?id='.$contact['id'].'">'.htmlspecialchars($display).'</a></li>'; - endforeach; +foreach($_['books'] as $id => $addressbook) { + echo '<h3 class="addressbook" data-id="'.$id.'">'.$addressbook['displayname'].'</h3>'; + echo '<ul class="contacts hidden">'; + foreach($addressbook['contacts'] as $contact) { + echo '<li role="button" book-id="'.$contact['addressbookid'].'" data-id="'.$contact['id'].'"><a href="index.php?id='.$contact['id'].'">'.$contact['displayname'].'</a></li>'; + } echo '</ul>'; - echo '</div>'; -endforeach; +} ?> -<script language="Javascript"> -$(document).ready(function() { - $('#leftcontent .addressbookname').click(function(event) { - $(this).next().toggle('slow'); - return false; - }).next().hide(); -}); -</script> |