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

60 lines
1.5 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('/');
$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;
}
}