Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
project
forena
Commits
8f5f1338
Commit
8f5f1338
authored
Oct 18, 2014
by
Pierre Vriens
Browse files
Correct info/error messages in configuration (admin)
parent
bd10bbe5
Changes
1
Hide whitespace changes
Inline
Side-by-side
forena.admin.inc
100755 → 100644
View file @
8f5f1338
...
...
@@ -140,8 +140,8 @@ function forena_settings() {
$form
[
'forena_report_repos'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Report Repository'
),
'#description'
=>
t
(
'Indicate the directory that you want to use for your report
s.
In order for you
to
'
.
'to be able to save reports, this directory should be writable by the web user. Relative'
.
'#description'
=>
t
(
'Indicate the directory that you want to use for
storing
your report
sources (frx files).
In order for you '
.
'to be able to save report
source
s, this directory should be writable by the web user. Relative
'
.
'paths should be entered relative to the base path of your drupal installation.'
),
'#default_value'
=>
$report_path
,
);
...
...
@@ -155,10 +155,9 @@ function forena_settings() {
$form
[
'forena_query_data_path'
]
=
array
(
'#type'
=>
'textfield'
,
'#title'
=>
t
(
'Custom Data Block Repository'
),
'#description'
=>
t
(
'Indicate the directory that you want to use to save custom created data blocks using
the forena query builder tool. These will override any module delivered data blocks. This needs to
be a directory that is writable by the web user but should not be browsable by the web. It defaults to
'
),
'#description'
=>
t
(
'Indicate the directory that you want to use to save custom created data blocks (SQLs or
XMLs) using the forena query builder tool. These will override any module delivered data blocks. This
needs to be a directory that is writable by the web user but should not be browsable by the web.'
),
'#default_value'
=>
Frx
::
DataFile
()
->
dir
,
);
...
...
@@ -190,41 +189,46 @@ function forena_settings_validate($form, &$form_state) {
if
(
$path
!=
$values
[
'forena_last_report_path'
])
{
if
(
!
file_exists
(
$path
))
{
try
{
mkdir
(
$path
);
if
(
file_exists
(
$path
))
{
drupal_set_message
(
t
(
'Created
direc
tory %s'
,
array
(
'%s'
=>
$path
)))
;
drupal_set_message
(
t
(
'Created
Report Reposi
tory %s'
,
array
(
'%s'
=>
$path
)))
;
}
mkdir
(
$path
);
}
catch
(
Exception
$e
)
{
Frx
::
error
(
t
(
'Unable to create
r
eport
direc
tory'
),
$e
->
getMessage
());
Frx
::
error
(
t
(
'Unable to create
R
eport
Reposi
tory'
),
$e
->
getMessage
());
}
}
}
if
(
!
file_exists
(
$path
)
||
!
is_writable
(
$path
))
{
form_set_error
(
'forena_report_repos'
,
'Report Directory must be writable by the web user'
);
if
(
!
file_exists
(
$path
))
{
form_set_error
(
'forena_report_repos'
,
t
(
'Report Repository ('
)
.
$path
.
t
(
') does not exist'
));
}
else
{
if
(
!
is_writable
(
$path
))
{
form_set_error
(
'forena_report_repos'
,
t
(
'Report Repository ('
)
.
$path
.
t
(
') must be writable by the web user'
));
}
}
if
(
isset
(
$values
[
'forena_query_data_path'
]))
{
$path
=
$values
[
'forena_query_data_path'
];
if
(
$path
!=
$values
[
'forena_last_query_data_path'
])
{
if
(
!
file_exists
(
$path
))
{
try
{
mkdir
(
$path
);
if
(
file_exists
(
$path
))
{
drupal_set_message
(
t
(
'Created
direc
tory %s'
,
array
(
'%s'
=>
$path
)))
;
drupal_set_message
(
t
(
'Created
Custom Data Block Reposi
tory %s'
,
array
(
'%s'
=>
$path
)))
;
}
}
catch
(
Exception
$e
)
{
Frx
::
error
(
t
(
'Unable to create
data direc
tory'
),
$e
->
getMessage
());
Frx
::
error
(
t
(
'Unable to create
Custom Data Block Reposi
tory'
),
$e
->
getMessage
());
}
}
}
if
(
!
file_exists
(
$path
)
||
!
is_writable
(
$path
))
{
form_set_error
(
'forena_query_data_path'
,
'Data Directory must be writable by the web user'
);
if
(
!
file_exists
(
$path
))
{
form_set_error
(
'forena_query_data_path'
,
t
(
'Custom Data Block Repository ('
)
.
$path
.
t
(
') does not exist'
));
}
else
{
if
(
!
is_writable
(
$path
))
{
form_set_error
(
'forena_query_data_path'
,
t
(
'Custom Data Block Repository ('
)
.
$path
.
t
(
') must be writable by the web user'
));
}
}
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment