]> source.dussan.org Git - nextcloud-server.git/commitdiff
Use proper index file.
authorThomas Tanghus <thomas@tanghus.net>
Tue, 14 Feb 2012 00:47:18 +0000 (01:47 +0100)
committerThomas Tanghus <thomas@tanghus.net>
Tue, 14 Feb 2012 00:47:18 +0000 (01:47 +0100)
apps/contacts/contacts.php [deleted file]
apps/contacts/index.php
apps/contacts/templates/index.php
apps/contacts/templates/index2.php [deleted file]

diff --git a/apps/contacts/contacts.php b/apps/contacts/contacts.php
deleted file mode 100644 (file)
index 938a6b1..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-<?php
-require_once('../../lib/base.php');
-
-// Check if we are a user
-OC_Util::checkLoggedIn();
-// 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);
-
-$addressbooks = OC_Contacts_Addressbook::active(OC_User::getUser());
-
-// Load the files we need
-OC_App::setActiveNavigationEntry( 'contacts_index' );
-
-// Load a specific user?
-$id = isset( $_GET['id'] ) ? $_GET['id'] : null;
-$details = array();
-
-// FIXME: This cannot work..?
-if(is_null($id) && count($contacts) > 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();
-
-?>
index 9012e5d8af8e954a598026c4a179e012c1f40714..c5115d16074d822e89db6353617f2fcb6f5c5633 100644 (file)
@@ -1,36 +1,15 @@
 <?php
 /**
- * ownCloud - Addressbook
- *
- * @author Jakob Sack
- * @copyright 2011 Jakob Sack mail@jakobsack.de
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU AFFERO GENERAL PUBLIC LICENSE
- * License as published by the Free Software Foundation; either
- * version 3 of the License, or any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU AFFERO GENERAL PUBLIC LICENSE for more details.
- *
- * You should have received a copy of the GNU Affero General Public
- * License along with this library.  If not, see <http://www.gnu.org/licenses/>.
- *
+ * Copyright (c) 2012 Thomas Tanghus <thomas@tanghus.net>
+ * 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();
+
+?>
index 5d9c312712f7fbf2b3b4197e0712e26ea682c246..4c0dfad617710ff827f6c651eadfa4c8242f7eb5 100644 (file)
 <div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
        <?php
                if ($_['id']){
-                       echo $this->inc("part.details");
+                       echo $this->inc('part.contact');
                }
                else{
-                       echo $this->inc("part.addcardform");
+                       echo $this->inc('part.no_contacts');
                }
        ?>
 </div>
diff --git a/apps/contacts/templates/index2.php b/apps/contacts/templates/index2.php
deleted file mode 100644 (file)
index 4c0dfad..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-<script type='text/javascript'>
-       var totalurl = '<?php echo OC_Helper::linkTo('contacts', 'carddav.php', null, true); ?>/addressbooks';
-</script>
-<div id="controls">
-       <form>
-               <input type="button" id="contacts_newcontact" value="<?php echo $l->t('Add Contact'); ?>">
-               <input type="button" id="chooseaddressbook" value="<?php echo $l->t('Addressbooks'); ?>">
-       </form>
-</div>
-<div id="leftcontent" class="leftcontent">
-       <ul id="contacts">
-               <?php echo $this->inc("part.contacts"); ?>
-       </ul>
-</div>
-<div id="rightcontent" class="rightcontent" data-id="<?php echo $_['id']; ?>">
-       <?php
-               if ($_['id']){
-                       echo $this->inc('part.contact');
-               }
-               else{
-                       echo $this->inc('part.no_contacts');
-               }
-       ?>
-</div>
-<!-- Dialogs -->
-<div id="dialog_holder"></div>
-<!-- End of Dialogs -->