From 68d86fadc73e5fa57a589f929fbf363413c37fab Mon Sep 17 00:00:00 2001 From: Frank Karlitschek Date: Sun, 6 May 2012 23:00:36 +0200 Subject: [PATCH] ported the oc_template class --- ajax/addbook.php | 2 +- ajax/chooseaddressbook.php | 2 +- ajax/contacts.php | 2 +- ajax/createaddressbook.php | 2 +- ajax/cropphoto.php | 2 +- ajax/editaddress.php | 2 +- ajax/editaddressbook.php | 2 +- ajax/editname.php | 2 +- ajax/importaddressbook.php | 2 +- ajax/importdialog.php | 2 +- ajax/loadcard.php | 2 +- ajax/loadintro.php | 2 +- ajax/loadphoto.php | 2 +- ajax/savecrop.php | 2 +- ajax/updateaddressbook.php | 2 +- index.php | 2 +- settings.php | 2 +- templates/part.chooseaddressbook.php | 2 +- templates/part.contact.php | 4 ++-- templates/part.edit_address_dialog.php | 2 +- templates/part.edit_name_dialog.php | 2 +- templates/part.import.php | 2 +- templates/part.importaddressbook.php | 2 +- 23 files changed, 24 insertions(+), 24 deletions(-) mode change 100644 => 100755 settings.php mode change 100644 => 100755 templates/part.edit_address_dialog.php mode change 100644 => 100755 templates/part.edit_name_dialog.php diff --git a/ajax/addbook.php b/ajax/addbook.php index 254af1c3..70f47cc8 100755 --- a/ajax/addbook.php +++ b/ajax/addbook.php @@ -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(); diff --git a/ajax/chooseaddressbook.php b/ajax/chooseaddressbook.php index 2fe55606..9088a4e9 100755 --- a/ajax/chooseaddressbook.php +++ b/ajax/chooseaddressbook.php @@ -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(); diff --git a/ajax/contacts.php b/ajax/contacts.php index 93e618a0..37d396cd 100755 --- a/ajax/contacts.php +++ b/ajax/contacts.php @@ -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(); diff --git a/ajax/createaddressbook.php b/ajax/createaddressbook.php index 772232b6..af7c19ee 100755 --- a/ajax/createaddressbook.php +++ b/ajax/createaddressbook.php @@ -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(), diff --git a/ajax/cropphoto.php b/ajax/cropphoto.php index 125dd107..7b286dbd 100755 --- a/ajax/cropphoto.php +++ b/ajax/cropphoto.php @@ -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(); diff --git a/ajax/editaddress.php b/ajax/editaddress.php index 4044eb5a..9fb35a0b 100755 --- a/ajax/editaddress.php +++ b/ajax/editaddress.php @@ -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]; diff --git a/ajax/editaddressbook.php b/ajax/editaddressbook.php index fe1806a7..7a9b757a 100755 --- a/ajax/editaddressbook.php +++ b/ajax/editaddressbook.php @@ -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(); diff --git a/ajax/editname.php b/ajax/editname.php index 155bee70..dc64eeb5 100755 --- a/ajax/editname.php +++ b/ajax/editname.php @@ -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); diff --git a/ajax/importaddressbook.php b/ajax/importaddressbook.php index 66cfa4f8..f93bbfa4 100755 --- a/ajax/importaddressbook.php +++ b/ajax/importaddressbook.php @@ -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(); diff --git a/ajax/importdialog.php b/ajax/importdialog.php index 7a564cce..5f8805a6 100755 --- a/ajax/importdialog.php +++ b/ajax/importdialog.php @@ -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(); diff --git a/ajax/loadcard.php b/ajax/loadcard.php index 047db4d9..4e6f2206 100755 --- a/ajax/loadcard.php +++ b/ajax/loadcard.php @@ -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); diff --git a/ajax/loadintro.php b/ajax/loadintro.php index 8ad828eb..6e8fcc4b 100755 --- a/ajax/loadintro.php +++ b/ajax/loadintro.php @@ -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 ))); diff --git a/ajax/loadphoto.php b/ajax/loadphoto.php index 9913fe13..ef429e82 100755 --- a/ajax/loadphoto.php +++ b/ajax/loadphoto.php @@ -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); diff --git a/ajax/savecrop.php b/ajax/savecrop.php index 5418e26c..cd470307 100755 --- a/ajax/savecrop.php +++ b/ajax/savecrop.php @@ -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); diff --git a/ajax/updateaddressbook.php b/ajax/updateaddressbook.php index 13f1c15a..19b5b3bd 100755 --- a/ajax/updateaddressbook.php +++ b/ajax/updateaddressbook.php @@ -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(), diff --git a/index.php b/index.php index 69e7d573..74b7c43c 100755 --- a/index.php +++ b/index.php @@ -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); diff --git a/settings.php b/settings.php old mode 100644 new mode 100755 index b8812882..c88fed0b --- a/settings.php +++ b/settings.php @@ -1,6 +1,6 @@ fetchPage(); ?> diff --git a/templates/part.chooseaddressbook.php b/templates/part.chooseaddressbook.php index 91b2f51c..a0ec053a 100755 --- a/templates/part.chooseaddressbook.php +++ b/templates/part.chooseaddressbook.php @@ -4,7 +4,7 @@ $option_addressbooks = OC_Contacts_Addressbook::all(OCP\USER::getUser()); for($i = 0; $i < count($option_addressbooks); $i++){ echo ""; - $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(); diff --git a/templates/part.contact.php b/templates/part.contact.php index 4c23dac7..74522be3 100755 --- a/templates/part.contact.php +++ b/templates/part.contact.php @@ -55,7 +55,7 @@ $id = isset($_['id']) ? $_['id'] : ''; @@ -69,7 +69,7 @@ $id = isset($_['id']) ? $_['id'] : ''; diff --git a/templates/part.edit_address_dialog.php b/templates/part.edit_address_dialog.php old mode 100644 new mode 100755 index 507a3aca..8b342503 --- a/templates/part.edit_address_dialog.php +++ b/templates/part.edit_address_dialog.php @@ -15,7 +15,7 @@ foreach(isset($adr['parameters']['TYPE'])?array($adr['parameters']['TYPE']):arra
diff --git a/templates/part.edit_name_dialog.php b/templates/part.edit_name_dialog.php old mode 100644 new mode 100755 index bb774b62..be45f9a5 --- a/templates/part.edit_name_dialog.php +++ b/templates/part.edit_name_dialog.php @@ -16,7 +16,7 @@ $addressbooks = isset($_['addressbooks'])?$_['addressbooks']:null;
diff --git a/templates/part.import.php b/templates/part.import.php index a2f8aefa..2dac7dd0 100755 --- a/templates/part.import.php +++ b/templates/part.import.php @@ -8,7 +8,7 @@ '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')); ?>