parent
2b48b733a3
commit
830efdccac
@ -0,0 +1,26 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Thomas Tanghus <thomas@tanghus.net> |
||||
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
require_once('../../../lib/base.php'); |
||||
|
||||
$l10n = new OC_L10N('contacts'); |
||||
|
||||
// Check if we are a user |
||||
OC_JSON::checkLoggedIn(); |
||||
OC_JSON::checkAppEnabled('contacts'); |
||||
|
||||
$userid = OC_User::getUser(); |
||||
$bookid = OC_Contacts_Addressbook::add($userid, $_POST['name'], null); |
||||
OC_Contacts_Addressbook::setActive($bookid, 1); |
||||
$book = OC_Contacts_Addressbook::find($bookid); |
||||
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); |
||||
$tmpl->assign('addressbook', $book); |
||||
OC_JSON::success(array( |
||||
'page' => $tmpl->fetchPage(), |
||||
'bookid' => $bookid, |
||||
)); |
||||
@ -0,0 +1,20 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
$l10n = new OC_L10N('contacts'); |
||||
if(!OC_USER::isLoggedIn()) { |
||||
die("<script type=\"text/javascript\">document.location = oc_webroot;</script>"); |
||||
} |
||||
OC_JSON::checkAppEnabled('contacts'); |
||||
$addressbook = OC_Contacts_Addressbook::find($_GET['bookid']); |
||||
$tmpl = new OC_Template("contacts", "part.editaddressbook"); |
||||
$tmpl->assign('new', false); |
||||
$tmpl->assign('addressbook', $addressbook); |
||||
$tmpl->printPage(); |
||||
?> |
||||
@ -0,0 +1,26 @@ |
||||
<?php |
||||
/** |
||||
* Copyright (c) 2011 Bart Visscher <bartv@thisnet.nl> |
||||
* This file is licensed under the Affero General Public License version 3 or |
||||
* later. |
||||
* See the COPYING-README file. |
||||
*/ |
||||
|
||||
require_once('../../../lib/base.php'); |
||||
|
||||
$l10n = new OC_L10N('contacts'); |
||||
|
||||
// Check if we are a user |
||||
OC_JSON::checkLoggedIn(); |
||||
OC_JSON::checkAppEnabled('contacts'); |
||||
|
||||
$bookid = $_POST['id']; |
||||
OC_Contacts_Addressbook::edit($bookid, $_POST['name'], null); |
||||
OC_Contacts_Addressbook::setActive($bookid, $_POST['active']); |
||||
$addressbook = OC_Contacts_Addressbook::find($bookid); |
||||
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields'); |
||||
$tmpl->assign('book', $book); |
||||
OC_JSON::success(array( |
||||
'page' => $tmpl->fetchPage(), |
||||
'addressbook' => $addressbook, |
||||
)); |
||||
@ -1,4 +1,4 @@ |
||||
<?php |
||||
echo "<td width=\"20px\"><input id=\"active_" . $_['addressbook']["id"] . "\" type=\"checkbox\" onClick=\"Contacts.UI.Addressbooks.activation(this, " . $_['addressbook']["id"] . ")\"" . ($_['addressbook']["active"] ? ' checked="checked"' : '') . "></td>"; |
||||
echo "<td><label for=\"active_" . $_['addressbook']["id"] . "\">" . $_['addressbook']["displayname"] . "</label></td>"; |
||||
echo "<td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.showCardDAVUrl('" . OC_User::getUser() . "', '" . $_['addressbook']["uri"] . "');\" title=\"" . $l->t("CardDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?bookid=" . $_['addressbook']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.Addressbooks.deleteAddressbook('" . $_['addressbook']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>"; |
||||
echo "<td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.showCardDAVUrl('" . OC_User::getUser() . "', '" . $_['addressbook']["uri"] . "');\" title=\"" . $l->t("CardDav Link") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/public.svg\"></a></td><td width=\"20px\"><a href=\"export.php?bookid=" . $_['addressbook']["id"] . "\" title=\"" . $l->t("Download") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/download.svg\"></a></td><td width=\"20px\"><a href=\"#\" title=\"" . $l->t("Edit") . "\" class=\"action\" onclick=\"Contacts.UI.Addressbooks.editAddressbook(this, " . $_['addressbook']["id"] . ");\"><img class=\"svg action\" src=\"../../core/img/actions/rename.svg\"></a></td><td width=\"20px\"><a href=\"#\" onclick=\"Contacts.UI.Addressbooks.deleteAddressbook('" . $_['addressbook']["id"] . "');\" title=\"" . $l->t("Delete") . "\" class=\"action\"><img class=\"svg action\" src=\"../../core/img/actions/delete.svg\"></a></td>"; |
||||
|
||||
Loading…
Reference in new issue