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,
|
use OCA\Contacts\App,
|
||||||
OCP\AppFramework\Controller,
|
OCP\AppFramework\Controller,
|
||||||
OCA\Contacts\Utils\Properties,
|
OCA\Contacts\Utils\Properties,
|
||||||
|
OCA\Contacts\ImportManager,
|
||||||
OCP\AppFramework\Http\TemplateResponse;
|
OCP\AppFramework\Http\TemplateResponse;
|
||||||
|
|
||||||
|
|
||||||
@ -28,6 +29,7 @@ class PageController extends Controller {
|
|||||||
public function index() {
|
public function index() {
|
||||||
\OC::$server->getNavigationManager()->setActiveEntry($this->appName);
|
\OC::$server->getNavigationManager()->setActiveEntry($this->appName);
|
||||||
|
|
||||||
|
$importManager = new ImportManager();
|
||||||
$imppTypes = Properties::getTypesForProperty('IMPP');
|
$imppTypes = Properties::getTypesForProperty('IMPP');
|
||||||
$adrTypes = Properties::getTypesForProperty('ADR');
|
$adrTypes = Properties::getTypesForProperty('ADR');
|
||||||
$phoneTypes = Properties::getTypesForProperty('TEL');
|
$phoneTypes = Properties::getTypesForProperty('TEL');
|
||||||
@ -67,6 +69,7 @@ class PageController extends Controller {
|
|||||||
'adrTypes' => $adrTypes,
|
'adrTypes' => $adrTypes,
|
||||||
'imppTypes' => $imppTypes,
|
'imppTypes' => $imppTypes,
|
||||||
'imProtocols' => $imProtocols,
|
'imProtocols' => $imProtocols,
|
||||||
|
'importManager' => $importManager,
|
||||||
));
|
));
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
|
@ -1,6 +1,3 @@
|
|||||||
<?php
|
|
||||||
use OCA\Contacts\ImportManager;
|
|
||||||
?>
|
|
||||||
<div id="app">
|
<div id="app">
|
||||||
<div id="app-navigation" class="loading">
|
<div id="app-navigation" class="loading">
|
||||||
<ul id="grouplist" class="hidden-on-load">
|
<ul id="grouplist" class="hidden-on-load">
|
||||||
@ -34,8 +31,7 @@ use OCA\Contacts\ImportManager;
|
|||||||
<select id="import_format">
|
<select id="import_format">
|
||||||
<option value="automatic"><?php p($l->t('Automatic format')); ?></option>
|
<option value="automatic"><?php p($l->t('Automatic format')); ?></option>
|
||||||
<?php
|
<?php
|
||||||
$importManager = new ImportManager();
|
$types = $_['importManager']->getTypes();
|
||||||
$types = $importManager->getTypes();
|
|
||||||
foreach ($types as $id => $label) {
|
foreach ($types as $id => $label) {
|
||||||
echo "<option value=\"$id\">$label</option>";
|
echo "<option value=\"$id\">$label</option>";
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user