Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
w2pext
plugin_dbui
Commits
05c20127
Commit
05c20127
authored
Nov 30, 2016
by
LE GAC Renaud
Browse files
Update Dbui to add protection.
parent
23008829
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
10 deletions
+19
-10
modules/plugin_dbui/dbui.py
modules/plugin_dbui/dbui.py
+19
-10
No files found.
modules/plugin_dbui/dbui.py
View file @
05c20127
...
@@ -12,7 +12,6 @@ from gluon.storage import Storage
...
@@ -12,7 +12,6 @@ from gluon.storage import Storage
from
gluon.tools
import
PluginManager
from
gluon.tools
import
PluginManager
from
helper
import
get_language
from
helper
import
get_language
myapp
=
current
.
request
.
application
defaults
=
Storage
(
defaults
=
Storage
(
...
@@ -32,13 +31,13 @@ defaults = Storage(
...
@@ -32,13 +31,13 @@ defaults = Storage(
app_html_jsduck
=
"static/docs/jsduck/index.html"
,
app_html_jsduck
=
"static/docs/jsduck/index.html"
,
app_html_user
=
"static/docs/user/index.html"
,
app_html_user
=
"static/docs/user/index.html"
,
app_html_reference
=
"static/docs/reference/index.html"
,
app_html_reference
=
"static/docs/reference/index.html"
,
app_pdf_api
=
"static/docs/pdf/%s_api.pdf"
%
myapp
,
app_pdf_api
=
"static/docs/pdf/%s_api.pdf"
,
app_pdf_reference
=
"static/docs/pdf/%s_reference.pdf"
%
myapp
,
app_pdf_reference
=
"static/docs/pdf/%s_reference.pdf"
,
app_pdf_user
=
"static/docs/pdf/%s_user.pdf"
%
myapp
,
app_pdf_user
=
"static/docs/pdf/%s_user.pdf"
,
# dbui URL
# dbui URL
dbui_conf
=
"/%s/plugin_dbui/dbui_conf"
%
myapp
,
dbui_conf
=
"/%s/plugin_dbui/dbui_conf"
,
dbui_conf_debug
=
"/%s/plugin_dbui/dbui_conf?debug"
%
myapp
,
dbui_conf_debug
=
"/%s/plugin_dbui/dbui_conf?debug"
,
dbui_script
=
"static/plugin_dbui/main.js"
,
dbui_script
=
"static/plugin_dbui/main.js"
,
# dbui documentation and license
# dbui documentation and license
...
@@ -274,13 +273,23 @@ class Dbui(object):
...
@@ -274,13 +273,23 @@ class Dbui(object):
# update values depending on language
# update values depending on language
lg
=
get_language
()
lg
=
get_language
()
f
=
lambda
x
:
(
x
%
lg
if
"%s"
in
x
else
x
)
plugins_paths
=
plugin
.
plugins_paths
plugins_paths
=
plugin
.
plugins_paths
paths_dbui
=
plugins_paths
[
"dbui"
]
plugins_paths
[
"dbui"
][
"lg"
]
=
f
(
plugins_paths
[
"dbui"
][
"lg"
])
paths_dbui
[
"lg"
]
=
paths_dbui
[
"lg"
]
%
lg
plugins_paths
[
"extjs"
][
"lg"
]
=
f
(
plugins_paths
[
"extjs"
][
"lg"
])
# update values depending on the application
myapp
=
current
.
request
.
application
f
=
lambda
x
:
(
x
%
myapp
if
"%s"
in
x
else
x
)
plugin
.
app_pdf_api
=
f
(
plugin
.
app_pdf_api
)
plugin
.
app_pdf_reference
=
f
(
plugin
.
app_pdf_reference
)
plugin
.
app_pdf_user
=
f
(
plugin
.
app_pdf_user
)
p
aths_extjs
=
plugin
s_paths
[
"extjs"
]
p
lugin
.
dbui_conf
=
f
(
plugin
.
dbui_conf
)
p
aths_extjs
[
"lg"
]
=
paths_extjs
[
"lg"
]
%
lg
p
lugin
.
dbui_conf_debug
=
f
(
plugin
.
dbui_conf_debug
)
@
staticmethod
@
staticmethod
def
initialise_ui
():
def
initialise_ui
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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