mirror of
https://github.com/owncloudarchive/contacts.git
synced 2025-01-18 07:52:21 +01:00
Move instantiation of ImportManager to PageController
This commit is contained in:
parent
f9aa396d01
commit
f699812f69
@ -13,6 +13,7 @@ namespace OCA\Contacts\Controller;
|
||||
use OCA\Contacts\App,
|
||||
OCP\AppFramework\Controller,
|
||||
OCA\Contacts\Utils\Properties,
|
||||
OCA\Contacts\ImportManager,
|
||||
OCP\AppFramework\Http\TemplateResponse;
|
||||
|
||||
|
||||
@ -28,6 +29,7 @@ class PageController extends Controller {
|
||||
public function index() {
|
||||
\OC::$server->getNavigationManager()->setActiveEntry($this->appName);
|
||||
|
||||
$importManager = new ImportManager();
|
||||
$imppTypes = Properties::getTypesForProperty('IMPP');
|
||||
$adrTypes = Properties::getTypesForProperty('ADR');
|
||||
$phoneTypes = Properties::getTypesForProperty('TEL');
|
||||
@ -67,6 +69,7 @@ class PageController extends Controller {
|
||||
'adrTypes' => $adrTypes,
|
||||
'imppTypes' => $imppTypes,
|
||||
'imProtocols' => $imProtocols,
|
||||
'importManager' => $importManager,
|
||||
));
|
||||
|
||||
return $response;
|
||||
|
@ -1,6 +1,3 @@
|
||||
<?php
|
||||
use OCA\Contacts\ImportManager;
|
||||
?>
|
||||
<div id="app">
|
||||
<div id="app-navigation" class="loading">
|
||||
<ul id="grouplist" class="hidden-on-load">
|
||||
@ -34,8 +31,7 @@ use OCA\Contacts\ImportManager;
|
||||
<select id="import_format">
|
||||
<option value="automatic"><?php p($l->t('Automatic format')); ?></option>
|
||||
<?php
|
||||
$importManager = new ImportManager();
|
||||
$types = $importManager->getTypes();
|
||||
$types = $_['importManager']->getTypes();
|
||||
foreach ($types as $id => $label) {
|
||||
echo "<option value=\"$id\">$label</option>";
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user