From: Thomas Tanghus Date: Tue, 14 Feb 2012 00:47:18 +0000 (+0100) Subject: Use proper index file. X-Git-Tag: v4.0.0beta~71^2~5^2~4^2~2^2~2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=53503148f3208ac5aa47e7ea654932a5c5af5c5a;p=nextcloud-server.git Use proper index file. --- diff --git a/apps/contacts/contacts.php b/apps/contacts/contacts.php deleted file mode 100644 index 938a6b13a04..00000000000 --- a/apps/contacts/contacts.php +++ /dev/null @@ -1,62 +0,0 @@ - 0) { - $id = $contacts[0]['id']; -} -if(!is_null($id)) { - $vcard = OC_Contacts_App::getContactVCard($id); - $details = OC_Contacts_VCard::structureContact($vcard); -} -$property_types = OC_Contacts_App::getAddPropertyOptions(); -$phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); - -$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); -$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); -$maxUploadFilesize = min($upload_max_filesize, $post_max_size); - -$freeSpace=OC_Filesystem::free_space('/'); -$freeSpace=max($freeSpace,0); -$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); - -OC_Util::addScript('','jquery.multiselect'); -//OC_Util::addScript('contacts','interface'); -OC_Util::addScript('contacts','contacts'); -OC_Util::addScript('contacts','jquery.combobox'); -OC_Util::addScript('contacts','jquery.inview'); -OC_Util::addScript('contacts','jquery.Jcrop'); -OC_Util::addScript('contacts','jquery.jec-1.3.3'); -OC_Util::addStyle('','jquery.multiselect'); -//OC_Util::addStyle('contacts','styles'); -OC_Util::addStyle('contacts','jquery.combobox'); -OC_Util::addStyle('contacts','jquery.Jcrop'); -OC_Util::addStyle('contacts','contacts'); - -$tmpl = new OC_Template( "contacts", "index2", "user" ); -$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); -$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize)); -$tmpl->assign('property_types',$property_types); -$tmpl->assign('phone_types',$phone_types); -$tmpl->assign('addressbooks', $addressbooks); -$tmpl->assign('contacts', $contacts); -$tmpl->assign('details', $details ); -$tmpl->assign('id',$id); -$tmpl->printPage(); - -?> diff --git a/apps/contacts/index.php b/apps/contacts/index.php index 9012e5d8af8..c5115d16074 100644 --- a/apps/contacts/index.php +++ b/apps/contacts/index.php @@ -1,36 +1,15 @@ . - * + * Copyright (c) 2012 Thomas Tanghus + * Copyright (c) 2011 Jakob Sack mail@jakobsack.de + * This file is licensed under the Affero General Public License version 3 or + * later. + * See the COPYING-README file. */ - -function contacts_namesort($a,$b){ - return strcmp($a['fullname'],$b['fullname']); -} - -// Init owncloud require_once('../../lib/base.php'); // Check if we are a user OC_Util::checkLoggedIn(); -OC_Util::checkAppEnabled('contacts'); - // Get active address books. This creates a default one if none exists. $ids = OC_Contacts_Addressbook::activeIds(OC_User::getUser()); $contacts = OC_Contacts_VCard::all($ids); @@ -47,33 +26,41 @@ $details = array(); if(is_null($id) && count($contacts) > 0) { $id = $contacts[0]['id']; } -$vcard = null; -$details = null; if(!is_null($id)) { $vcard = OC_Contacts_App::getContactVCard($id); - if(!is_null($vcard)) { - $details = OC_Contacts_VCard::structureContact($vcard); - } + $details = OC_Contacts_VCard::structureContact($vcard); } - -// Include Style and Script -OC_Util::addScript('contacts','interface'); -OC_Util::addScript('contacts','jquery.inview'); -OC_Util::addScript('', 'jquery.multiselect'); -OC_Util::addStyle('contacts','styles'); -//OC_Util::addStyle('contacts','formtastic'); - $property_types = OC_Contacts_App::getAddPropertyOptions(); -$adr_types = OC_Contacts_App::getTypesOfProperty('ADR'); $phone_types = OC_Contacts_App::getTypesOfProperty('TEL'); -// Process the template -$tmpl = new OC_Template( 'contacts', 'index', 'user' ); +$upload_max_filesize = OC_Helper::computerFileSize(ini_get('upload_max_filesize')); +$post_max_size = OC_Helper::computerFileSize(ini_get('post_max_size')); +$maxUploadFilesize = min($upload_max_filesize, $post_max_size); + +$freeSpace=OC_Filesystem::free_space('/'); +$freeSpace=max($freeSpace,0); +$maxUploadFilesize = min($maxUploadFilesize ,$freeSpace); + +OC_Util::addScript('','jquery.multiselect'); +OC_Util::addScript('contacts','contacts'); +OC_Util::addScript('contacts','jquery.combobox'); +OC_Util::addScript('contacts','jquery.inview'); +OC_Util::addScript('contacts','jquery.Jcrop'); +OC_Util::addStyle('','jquery.multiselect'); +//OC_Util::addStyle('contacts','styles'); +OC_Util::addStyle('contacts','jquery.combobox'); +OC_Util::addStyle('contacts','jquery.Jcrop'); +OC_Util::addStyle('contacts','contacts'); + +$tmpl = new OC_Template( "contacts", "index", "user" ); +$tmpl->assign('uploadMaxFilesize', $maxUploadFilesize); +$tmpl->assign('uploadMaxHumanFilesize', OC_Helper::humanFileSize($maxUploadFilesize)); $tmpl->assign('property_types',$property_types); -$tmpl->assign('adr_types',$adr_types); $tmpl->assign('phone_types',$phone_types); $tmpl->assign('addressbooks', $addressbooks); $tmpl->assign('contacts', $contacts); $tmpl->assign('details', $details ); $tmpl->assign('id',$id); $tmpl->printPage(); + +?> diff --git a/apps/contacts/templates/index.php b/apps/contacts/templates/index.php index 5d9c312712f..4c0dfad6177 100644 --- a/apps/contacts/templates/index.php +++ b/apps/contacts/templates/index.php @@ -15,10 +15,10 @@
inc("part.details"); + echo $this->inc('part.contact'); } else{ - echo $this->inc("part.addcardform"); + echo $this->inc('part.no_contacts'); } ?>
diff --git a/apps/contacts/templates/index2.php b/apps/contacts/templates/index2.php deleted file mode 100644 index 4c0dfad6177..00000000000 --- a/apps/contacts/templates/index2.php +++ /dev/null @@ -1,27 +0,0 @@ - -
-
- - -
-
-
-
    - inc("part.contacts"); ?> -
-
-
- inc('part.contact'); - } - else{ - echo $this->inc('part.no_contacts'); - } - ?> -
- -
-