1
0
mirror of https://github.com/owncloudarchive/contacts.git synced 2024-12-01 13:24:10 +01:00
OwncloudContactsOfficial/lib/controller/pagecontroller.php

79 lines
2.4 KiB
PHP
Raw Normal View History

2013-10-17 02:10:34 +02:00
<?php
/**
2014-01-26 00:40:22 +01:00
* @author Thomas Tanghus
* @copyright 2013-2014 Thomas Tanghus (thomas@tanghus.net)
*
2013-10-17 02:10:34 +02:00
* This file is licensed under the Affero General Public License version 3 or
* later.
* See the COPYING-README file.
*/
namespace OCA\Contacts\Controller;
use OCA\Contacts\App,
OCP\AppFramework\Controller,
2013-10-17 02:10:34 +02:00
OCA\Contacts\Utils\Properties,
OCA\Contacts\ImportManager,
2013-10-17 02:10:34 +02:00
OCP\AppFramework\Http\TemplateResponse;
/**
* Controller class for groups/categories
*/
class PageController extends Controller {
/**
* @NoAdminRequired
* @NoCSRFRequired
*/
public function index() {
\OC::$server->getNavigationManager()->setActiveEntry($this->appName);
2013-10-17 02:10:34 +02:00
$importManager = new ImportManager();
2014-03-18 00:58:01 +01:00
$imppTypes = Properties::getTypesForProperty('IMPP');
$adrTypes = Properties::getTypesForProperty('ADR');
$phoneTypes = Properties::getTypesForProperty('TEL');
$emailTypes = Properties::getTypesForProperty('EMAIL');
2013-10-17 02:10:34 +02:00
$ims = Properties::getIMOptions();
2014-03-18 00:58:01 +01:00
$imProtocols = array();
2013-10-17 02:10:34 +02:00
foreach($ims as $name => $values) {
2014-03-18 00:58:01 +01:00
$imProtocols[$name] = $values['displayname'];
2013-10-17 02:10:34 +02:00
}
$maxUploadFilesize = \OCP\Util::maxUploadFilesize('/');
\OCP\Util::addScript('', 'jquery.multiselect');
\OCP\Util::addScript('', 'tags');
\OCP\Util::addScript('contacts', 'jquery.combobox');
\OCP\Util::addScript('contacts', 'modernizr.custom');
\OCP\Util::addScript('contacts', 'app');
\OCP\Util::addScript('contacts', 'addressbooks');
\OCP\Util::addScript('contacts', 'contacts');
\OCP\Util::addScript('contacts', 'storage');
\OCP\Util::addScript('contacts', 'groups');
\OCP\Util::addScript('contacts', 'jquery.ocaddnew');
\OCP\Util::addScript('contacts', 'otherbackendconfig');
2013-10-17 02:10:34 +02:00
\OCP\Util::addScript('files', 'jquery.fileupload');
\OCP\Util::addScript('3rdparty/Jcrop', 'jquery.Jcrop');
\OCP\Util::addStyle('', 'jquery.multiselect');
\OCP\Util::addStyle('contacts', 'jquery.combobox');
\OCP\Util::addStyle('contacts', 'jquery.ocaddnew');
\OCP\Util::addStyle('3rdparty/Jcrop', 'jquery.Jcrop');
\OCP\Util::addStyle('contacts', 'contacts');
$response = new TemplateResponse($this->appName, 'contacts');
2013-10-17 02:10:34 +02:00
$response->setParams(array(
'uploadMaxFilesize' => $maxUploadFilesize,
'uploadMaxHumanFilesize' => \OCP\Util::humanFileSize($maxUploadFilesize),
2014-03-18 00:58:01 +01:00
'phoneTypes' => $phoneTypes,
'emailTypes' => $emailTypes,
'adrTypes' => $adrTypes,
'imppTypes' => $imppTypes,
'imProtocols' => $imProtocols,
'importManager' => $importManager,
2013-10-17 02:10:34 +02:00
));
return $response;
}
}