1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2025-01-18 07:52:21 +01:00

Contacts: Load a server-side generated js script with preferences.

This commit is contained in:
Thomas Tanghus 2013-04-01 03:44:46 +02:00
parent 43c288bb9f
commit 0aa879dc45
2 changed files with 28 additions and 0 deletions

View File

@ -20,6 +20,9 @@ $this->create('contacts_index', '/')
// }
// );
$this->create('contacts_jsconfig', 'ajax/config.js')
->actionInclude('contacts/js/config.php');
/* TODO:
- Check what it requires to be a RESTful API. I think maybe {user}
shouldn't be in the URI but be authenticated in headers or elsewhere.

25
js/config.php Normal file
View File

@ -0,0 +1,25 @@
<?php
/**
* ownCloud - Addressbook
*
* @author Thomas Tanghus
* @copyright 2012 Thomas Tanghus <thomas@tanghus.net>
*
* 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/>.
*
*/
OCP\JSON::setContentTypeHeader('text/javascript');
OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('contacts');