iniWrapper = $iniWrapper; $this->request = $request; $this->config = $config; $this->dataDirPath = $this->config->getSystemValue('datadirectory').'/gpxedit'; if (! is_dir($this->dataDirPath)){ mkdir($this->dataDirPath); } if (! is_dir($this->dataDirPath.'/symbols')){ mkdir($this->dataDirPath.'/symbols'); } } /** * @return TemplateResponse */ public function getForm() { //$extraSymbolList = Array(Array('name'=>'plop', 'url'=>'huhu'), Array('name'=>'lll', 'url'=>'uuu')); $extraSymbolList = Array(); foreach(globRecursive($this->dataDirPath.'/symbols', '*.png', False) as $symbolfile){ $filename = basename($symbolfile); array_push($extraSymbolList, Array('name'=>str_replace('.png', '', $filename), 'url'=>$filename)); } $parameters = [ 'extraSymbolList' => $extraSymbolList ]; return new TemplateResponse('gpxedit', 'admin', $parameters, ''); } /** * @return string the section ID, e.g. 'sharing' */ public function getSection() { return 'additional'; } /** * @return int whether the form should be rather on the top or bottom of * the admin section. The forms are arranged in ascending order of the * priority values. It is required to return a value between 0 and 100. * * E.g.: 70 */ public function getPriority() { return 5; } }