echo htmlspecialchars($_['addressbook']['displayname']);
?>
">
	</td>
</tr>
<?php 
if (!$_['new']) {
    ?>
<tr>
	<td></td>
	<td>
		<input id="edit_active_<?php 
    echo $_['addressbook']['id'];
    ?>
" type="checkbox"<?php 
    echo OC_Contacts_Addressbook::isActive($_['addressbook']['id']) ? ' checked="checked"' : '';
    ?>
>
		<label for="edit_active_<?php 
    echo $_['addressbook']['id'];
    ?>
">
			<?php 
    echo $l->t('Active');
    ?>
		</label>
	</td>
</tr>
<?php 
}
?>
示例#2
0
<?php

/**
 * Copyright (c) 2011 Thomas Tanghus <*****@*****.**>
 * Copyright (c) 2011 Bart Visscher <*****@*****.**>
 * This file is licensed under the Affero General Public License version 3 or
 * later.
 * See the COPYING-README file.
 */
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');
OCP\JSON::callCheck();
$bookid = $_POST['bookid'];
$book = OC_Contacts_App::getAddressbook($bookid);
// is owner access check
if (!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) {
    OCP\Util::writeLog('contacts', 'ajax/activation.php: Error activating addressbook: ' . $bookid, OCP\Util::ERROR);
    OCP\JSON::error(array('data' => array('message' => OC_Contacts_App::$l10n->t('Error (de)activating addressbook.'))));
    exit;
}
OCP\JSON::success(array('active' => OC_Contacts_Addressbook::isActive($bookid), 'bookid' => $bookid, 'book' => $book));
<div id="chooseaddressbook_dialog" title="<?php 
echo $l->t("Configure Address Books");
?>
">
<table width="100%" style="border: 0;">
<?php 
$option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
for ($i = 0; $i < count($option_addressbooks); $i++) {
    echo "<tr>";
    $tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
    $tmpl->assign('addressbook', $option_addressbooks[$i]);
    $tmpl->assign('active', OC_Contacts_Addressbook::isActive($option_addressbooks[$i]['id']));
    $tmpl->printpage();
    echo "</tr>";
}
?>
<tr>
	<td colspan="5" style="padding: 0.5em;">
		<a class="button" href="#" onclick="Contacts.UI.Addressbooks.newAddressbook(this);"><?php 
echo $l->t('New Address Book');
?>
</a>
		<a class="button" href="#" onclick="Contacts.UI.Addressbooks.importAddressbook(this);"><?php 
echo $l->t('Import from VCF');
?>
</a>
	</td>
</tr>
<tr>
	<td colspan="5">
		<p style="margin: 0 auto;width: 90%;"><input style="display:none;width: 90%;float: left;" type="text" id="carddav_url" onmouseover="$('#carddav_url').select();" title="<?php