mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-29 11:24:11 +01:00
First try of implementing assignHTML
This commit is contained in:
parent
65c59b6c9d
commit
3bb0cbff47
@ -14,7 +14,7 @@ $book = array(
|
||||
'displayname' => '',
|
||||
);
|
||||
$tmpl = new OCP\Template('contacts', 'part.editaddressbook');
|
||||
$tmpl->assign('new', true);
|
||||
$tmpl->assign('addressbook', $book);
|
||||
$tmpl->assignHTML('new', true);
|
||||
$tmpl->assignHTML('addressbook', $book);
|
||||
$tmpl->printPage();
|
||||
?>
|
||||
|
@ -33,7 +33,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
|
||||
}
|
||||
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
||||
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$tmpl->assign('addressbook', $addressbook);
|
||||
$tmpl->assignHTML('addressbook', $addressbook);
|
||||
OCP\JSON::success(array(
|
||||
'page' => $tmpl->fetchPage(),
|
||||
'addressbook' => $addressbook,
|
||||
|
@ -11,7 +11,7 @@ OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('contacts');
|
||||
$addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']);
|
||||
$tmpl = new OCP\Template("contacts", "part.editaddressbook");
|
||||
$tmpl->assign('new', false);
|
||||
$tmpl->assign('addressbook', $addressbook);
|
||||
$tmpl->assignHTML('new', false);
|
||||
$tmpl->assignHTML('addressbook', $addressbook);
|
||||
$tmpl->printPage();
|
||||
?>
|
||||
|
@ -36,12 +36,12 @@ $phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
|
||||
$email_types = OC_Contacts_App::getTypesOfProperty('EMAIL');
|
||||
|
||||
$tmpl = new OCP\Template('contacts','part.contact');
|
||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assign('adr_types',$adr_types);
|
||||
$tmpl->assign('phone_types',$phone_types);
|
||||
$tmpl->assign('email_types',$email_types);
|
||||
$tmpl->assign('id','');
|
||||
$tmpl->assignHTML('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assignHTML('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assignHTML('adr_types',$adr_types);
|
||||
$tmpl->assignHTML('phone_types',$phone_types);
|
||||
$tmpl->assignHTML('email_types',$email_types);
|
||||
$tmpl->assignHTML('id','');
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
OCP\JSON::success(array('data' => array( 'page' => $page )));
|
||||
|
20
index.php
20
index.php
@ -59,16 +59,16 @@ OCP\Util::addStyle('contacts','jquery.Jcrop');
|
||||
OCP\Util::addStyle('contacts','contacts');
|
||||
|
||||
$tmpl = new OCP\Template( "contacts", "index", "user" );
|
||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assign('property_types', $property_types);
|
||||
$tmpl->assign('phone_types', $phone_types);
|
||||
$tmpl->assign('email_types', $email_types);
|
||||
$tmpl->assign('categories', $categories);
|
||||
$tmpl->assign('addressbooks', $addressbooks);
|
||||
$tmpl->assign('contacts', $contacts);
|
||||
$tmpl->assign('details', $details );
|
||||
$tmpl->assign('id',$id);
|
||||
$tmpl->assignHTML('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assignHTML('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assignHTML('property_types', $property_types);
|
||||
$tmpl->assignHTML('phone_types', $phone_types);
|
||||
$tmpl->assignHTML('email_types', $email_types);
|
||||
$tmpl->assignHTML('categories', $categories);
|
||||
$tmpl->assignHTML('addressbooks', $addressbooks);
|
||||
$tmpl->assignHTML('contacts', $contacts);
|
||||
$tmpl->assignHTML('details', $details );
|
||||
$tmpl->assignHTML('id',$id);
|
||||
$tmpl->printPage();
|
||||
|
||||
?>
|
||||
|
@ -5,8 +5,8 @@ $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->assignHTML('addressbook', $option_addressbooks[$i]);
|
||||
$tmpl->assignHTML('active', OC_Contacts_Addressbook::isActive($option_addressbooks[$i]['id']));
|
||||
$tmpl->printpage();
|
||||
echo "</tr>";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user