admin settings text, fix bug when extra symbol directory does not exists

merge-requests/1/head
Julien Veyssier 2016-12-13 17:49:15 +01:00
parent bbf0df0bf6
commit fc02fcc93f
2 changed files with 7 additions and 4 deletions

View File

@ -144,9 +144,11 @@ class PageController extends Controller {
// extra symbols
$dataDirPath = $this->config->getSystemValue('datadirectory').'/gpxedit';
$extraSymbolList = Array();
foreach(globRecursive($dataDirPath.'/symbols', '*.png', False) as $symbolfile){
$filename = basename($symbolfile);
array_push($extraSymbolList, Array('smallname'=>str_replace('.png', '', $filename), 'name'=>$filename));
if (is_dir($dataDirPath.'/symbols')){
foreach(globRecursive($dataDirPath.'/symbols', '*.png', False) as $symbolfile){
$filename = basename($symbolfile);
array_push($extraSymbolList, Array('smallname'=>str_replace('.png', '', $filename), 'name'=>$filename));
}
}
// PARAMS to view

View File

@ -4,7 +4,7 @@ OCP\Util::addstyle('gpxedit', 'admin');
?>
<div class="section" id="gpxedit">
<h2><?php p($l->t('GpxEdit additional settings')); ?></h2>
<h2><?php p($l->t('GpxEdit admin settings')); ?></h2>
<h3><?php p($l->t('Extra symbols')); ?> </h3>
<label><?php p($l->t('Those symbols will be available in GpxEdit.')); ?></label><br/>
<label><?php p($l->t('Keep in mind that only symbol names are saved in the gpx files. Other programs will display default symbol if they do not know a symbol name.')); ?></label><br/>
@ -33,6 +33,7 @@ OCP\Util::addstyle('gpxedit', 'admin');
<label><?php p($l->t('Recommended image ratio : 1:1')); ?></label><br/>
<label><?php p($l->t('Recommended image resolution : between 24x24 and 50x50')); ?></label><br/>
<label><?php p($l->t('Image format : png')); ?></label><br/>
<form class="uploadButton" method="post" action="<?php p($_['uploadPath']) ?>">
<label for="addExtraSymbolName">New symbol name :</label>
<input type="text" name="addExtraSymbolName" id="addExtraSymbolName"></input>