mirror of
https://github.com/owncloudarchive/contacts.git
synced 2024-11-28 10:24:11 +01:00
ported the oc_template class
This commit is contained in:
parent
2dfd5cebd2
commit
68d86fadc7
@ -13,7 +13,7 @@ $book = array(
|
||||
'id' => 'new',
|
||||
'displayname' => '',
|
||||
);
|
||||
$tmpl = new OC_Template('contacts', 'part.editaddressbook');
|
||||
$tmpl = new OCP\Template('contacts', 'part.editaddressbook');
|
||||
$tmpl->assign('new', true);
|
||||
$tmpl->assign('addressbook', $book);
|
||||
$tmpl->printPage();
|
||||
|
@ -10,5 +10,5 @@
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('contacts');
|
||||
|
||||
$output = new OC_TEMPLATE("contacts", "part.chooseaddressbook");
|
||||
$output = new OCP\Template("contacts", "part.chooseaddressbook");
|
||||
$output -> printpage();
|
||||
|
@ -12,7 +12,7 @@ OCP\JSON::checkAppEnabled('contacts');
|
||||
|
||||
$ids = OC_Contacts_Addressbook::activeIds(OCP\USER::getUser());
|
||||
$contacts = OC_Contacts_VCard::all($ids);
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.contacts");
|
||||
$tmpl = new OCP\Template("contacts", "part.contacts");
|
||||
$tmpl->assign('contacts', $contacts);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
|
@ -32,7 +32,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, 1)) {
|
||||
//exit();
|
||||
}
|
||||
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
||||
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$tmpl->assign('addressbook', $addressbook);
|
||||
OCP\JSON::success(array(
|
||||
'page' => $tmpl->fetchPage(),
|
||||
|
@ -30,7 +30,7 @@ OCP\JSON::checkAppEnabled('contacts');
|
||||
$tmp_path = $_GET['tmp_path'];
|
||||
$id = $_GET['id'];
|
||||
OCP\Util::writeLog('contacts','ajax/cropphoto.php: tmp_path: '.$tmp_path.', exists: '.file_exists($tmp_path), OCP\Util::DEBUG);
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.cropphoto");
|
||||
$tmpl = new OCP\Template("contacts", "part.cropphoto");
|
||||
$tmpl->assign('tmp_path', $tmp_path);
|
||||
$tmpl->assign('id', $id);
|
||||
$page = $tmpl->fetchPage();
|
||||
|
@ -15,7 +15,7 @@ $checksum = isset($_GET['checksum'])?$_GET['checksum']:'';
|
||||
$vcard = OC_Contacts_App::getContactVCard($id);
|
||||
$adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
|
||||
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.edit_address_dialog");
|
||||
$tmpl = new OCP\Template("contacts", "part.edit_address_dialog");
|
||||
if($checksum) {
|
||||
$line = OC_Contacts_App::getPropertyLineByChecksum($vcard, $checksum);
|
||||
$element = $vcard->children[$line];
|
||||
|
@ -10,7 +10,7 @@
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('contacts');
|
||||
$addressbook = OC_Contacts_App::getAddressbook($_GET['bookid']);
|
||||
$tmpl = new OC_Template("contacts", "part.editaddressbook");
|
||||
$tmpl = new OCP\Template("contacts", "part.editaddressbook");
|
||||
$tmpl->assign('new', false);
|
||||
$tmpl->assign('addressbook', $addressbook);
|
||||
$tmpl->printPage();
|
||||
|
@ -18,7 +18,7 @@ function debug($msg) {
|
||||
OCP\Util::writeLog('contacts','ajax/editname.php: '.$msg, OCP\Util::DEBUG);
|
||||
}
|
||||
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.edit_name_dialog");
|
||||
$tmpl = new OCP\Template("contacts", "part.edit_name_dialog");
|
||||
|
||||
$id = isset($_GET['id'])?$_GET['id']:'';
|
||||
debug('id: '.$id);
|
||||
|
@ -16,7 +16,7 @@ $freeSpace=OC_Filesystem::free_space('/');
|
||||
$freeSpace=max($freeSpace,0);
|
||||
$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace);
|
||||
|
||||
$tmpl = new OC_Template('contacts', 'part.importaddressbook');
|
||||
$tmpl = new OCP\Template('contacts', 'part.importaddressbook');
|
||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->printpage();
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
OCP\JSON::checkLoggedIn();
|
||||
OCP\App::checkAppEnabled('contacts');
|
||||
$tmpl = new OC_Template('contacts', 'part.import');
|
||||
$tmpl = new OCP\Template('contacts', 'part.import');
|
||||
$tmpl->assign('path', $_POST['path']);
|
||||
$tmpl->assign('filename', $_POST['filename']);
|
||||
$tmpl->printpage();
|
||||
|
@ -49,7 +49,7 @@ $adr_types = OC_Contacts_App::getTypesOfProperty('ADR');
|
||||
$phone_types = OC_Contacts_App::getTypesOfProperty('TEL');
|
||||
$email_types = OC_Contacts_App::getTypesOfProperty('EMAIL');
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.contact');
|
||||
$tmpl = new OCP\Template('contacts','part.contact');
|
||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assign('adr_types',$adr_types);
|
||||
|
@ -25,7 +25,7 @@ OCP\JSON::checkLoggedIn();
|
||||
OCP\JSON::checkAppEnabled('contacts');
|
||||
|
||||
|
||||
$tmpl = new OC_Template('contacts','part.no_contacts');
|
||||
$tmpl = new OCP\Template('contacts','part.no_contacts');
|
||||
$page = $tmpl->fetchPage();
|
||||
|
||||
OCP\JSON::success(array('data' => array( 'page' => $page )));
|
||||
|
@ -53,7 +53,7 @@ foreach($vcard->children as $property){
|
||||
}
|
||||
}
|
||||
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto");
|
||||
$tmpl = new OCP\Template("contacts", "part.contactphoto");
|
||||
$tmpl->assign('id', $id);
|
||||
if($refresh) {
|
||||
$tmpl->assign('refresh', 1);
|
||||
|
@ -101,7 +101,7 @@ if(file_exists($tmp_path)) {
|
||||
}
|
||||
unlink($tmpfname);
|
||||
//$result=array( "status" => "success", 'mime'=>$image->mimeType(), 'tmp'=>$tmp_path);
|
||||
$tmpl = new OC_TEMPLATE("contacts", "part.contactphoto");
|
||||
$tmpl = new OCP\Template("contacts", "part.contactphoto");
|
||||
$tmpl->assign('tmp_path', $tmpfname);
|
||||
$tmpl->assign('mime', $image->mimeType());
|
||||
$tmpl->assign('id', $id);
|
||||
|
@ -35,7 +35,7 @@ if(!OC_Contacts_Addressbook::setActive($bookid, $_POST['active'])) {
|
||||
}
|
||||
|
||||
$addressbook = OC_Contacts_App::getAddressbook($bookid);
|
||||
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$tmpl = new OCP\Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$tmpl->assign('addressbook', $addressbook);
|
||||
OCP\JSON::success(array(
|
||||
'page' => $tmpl->fetchPage(),
|
||||
|
@ -58,7 +58,7 @@ OCP\Util::addStyle('contacts','jquery.combobox');
|
||||
OCP\Util::addStyle('contacts','jquery.Jcrop');
|
||||
OCP\Util::addStyle('contacts','contacts');
|
||||
|
||||
$tmpl = new OC_Template( "contacts", "index", "user" );
|
||||
$tmpl = new OCP\Template( "contacts", "index", "user" );
|
||||
$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize);
|
||||
$tmpl->assign('uploadMaxHumanFilesize', OCP\Util::humanFileSize($maxUploadFilesize));
|
||||
$tmpl->assign('property_types', $property_types);
|
||||
|
2
settings.php
Normal file → Executable file
2
settings.php
Normal file → Executable file
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
|
||||
$tmpl = new OC_Template( 'contacts', 'settings');
|
||||
$tmpl = new OCP\Template( 'contacts', 'settings');
|
||||
|
||||
return $tmpl->fetchPage();
|
||||
?>
|
||||
|
@ -4,7 +4,7 @@
|
||||
$option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser());
|
||||
for($i = 0; $i < count($option_addressbooks); $i++){
|
||||
echo "<tr>";
|
||||
$tmpl = new OC_Template('contacts', 'part.chooseaddressbook.rowfields');
|
||||
$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();
|
||||
|
@ -55,7 +55,7 @@ $id = isset($_['id']) ? $_['id'] : '';
|
||||
<input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
|
||||
<input type="email" required="required" class="nonempty contacts_property" name="value" value="" x-moz-errormessage="<?php echo $l->t('Please specify a valid email address.'); ?>" placeholder="<?php echo $l->t('Enter email address'); ?>" />
|
||||
<select class="hidden" multiple="multiple" name="parameters[TYPE][]">
|
||||
<?php echo html_select_options($_['email_types'], array()) ?>
|
||||
<?php echo OCP\html_select_options($_['email_types'], array()) ?>
|
||||
</select>
|
||||
<span class="listactions"><a class="action mail" title="<?php echo $l->t('Mail to address'); ?>"></a>
|
||||
<a role="button" class="action delete" title="<?php echo $l->t('Delete email address'); ?>"></a></span></li>
|
||||
@ -69,7 +69,7 @@ $id = isset($_['id']) ? $_['id'] : '';
|
||||
<input type="checkbox" class="contacts_property tip" name="parameters[TYPE][]" value="PREF" title="<?php echo $l->t('Preferred'); ?>" />
|
||||
<input type="text" required="required" class="nonempty contacts_property" name="value" value="" placeholder="<?php echo $l->t('Enter phone number'); ?>" />
|
||||
<select multiple="multiple" name="parameters[TYPE][]">
|
||||
<?php echo html_select_options($_['phone_types'], array()) ?>
|
||||
<?php echo OCP\html_select_options($_['phone_types'], array()) ?>
|
||||
</select>
|
||||
<a role="button" class="action delete" title="<?php echo $l->t('Delete phone number'); ?>"></a></li>
|
||||
</ul>
|
||||
|
2
templates/part.edit_address_dialog.php
Normal file → Executable file
2
templates/part.edit_address_dialog.php
Normal file → Executable file
@ -15,7 +15,7 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
|
||||
</dt>
|
||||
<dd>
|
||||
<select id="adr_type" name="parameters[ADR][TYPE]" size="1">
|
||||
<?php echo html_select_options($_['adr_types'], $types) ?>
|
||||
<?php echo OCP\html_select_options($_['adr_types'], $types) ?>
|
||||
</select>
|
||||
</dd>
|
||||
<dt>
|
||||
|
2
templates/part.edit_name_dialog.php
Normal file → Executable file
2
templates/part.edit_name_dialog.php
Normal file → Executable file
@ -16,7 +16,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null;
|
||||
<dt><label for="addressbook"><?php echo $l->t('Addressbook'); ?></label></dt>
|
||||
<dd>
|
||||
<select id="aid" name="aid" size="1">
|
||||
<?php echo html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
|
||||
<?php echo OCP\html_select_options($_['addressbooks'], null, array('value'=>'id', 'label'=>'displayname')); ?>
|
||||
</select>
|
||||
</dd>
|
||||
<?php }} ?>
|
||||
|
@ -8,7 +8,7 @@
|
||||
<?php
|
||||
$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
|
||||
$contacts_options[] = array('id'=>'newaddressbook', 'displayname'=>$l->t('create a new addressbook'));
|
||||
echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
|
||||
echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
|
||||
?>
|
||||
</select>
|
||||
<div id="newaddressbookform" style="display: none;">
|
||||
|
@ -14,7 +14,7 @@
|
||||
<select id="book" name="book" class="float">
|
||||
<?php
|
||||
$contacts_options = OC_Contacts_Addressbook::all(OCP\USER::getUser());
|
||||
echo html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
|
||||
echo OCP\html_select_options($contacts_options, $contacts_options[0]['id'], array('value'=>'id', 'label'=>'displayname'));
|
||||
?>
|
||||
</select>
|
||||
<span id="import_drop_target" class="droptarget float"><?php echo $l->t("Drop a VCF file to import contacts."); ?> (Max. <?php echo $_['uploadMaxHumanFilesize']; ?>)</span>
|
||||
|
Loading…
Reference in New Issue
Block a user