Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/HuasoFoundries/phpPgAdmin6.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Figueroa <amenadiel@gmail.com>2021-01-06 22:40:13 +0300
committerFelipe Figueroa <amenadiel@gmail.com>2021-01-06 22:40:13 +0300
commit79aa14c04217f978fe7bbe88920cde62cb1f994a (patch)
treeeab733594cc7c4e810520074f0056107beb53b03
parentfb579d2a45da94000d116fea82875a9e507f47d5 (diff)
replaced most usages of stc/views
-rw-r--r--assets/js/ac_insert_row.js2
-rw-r--r--assets/js/jstree_events.js19
-rw-r--r--assets/templates/browser.twig33
-rw-r--r--assets/templates/components/browser_body.twig24
-rw-r--r--assets/templates/components/common_body.twig35
-rw-r--r--assets/templates/components/common_head.twig93
-rw-r--r--assets/templates/components/tabs.twig30
-rw-r--r--assets/templates/components/trail.twig81
-rw-r--r--assets/templates/deprecated.iframe_view.twig18
-rw-r--r--assets/templates/footer.twig44
-rw-r--r--assets/templates/footer_iframe.twig26
-rw-r--r--assets/templates/header.twig32
-rw-r--r--assets/templates/header_sqledit.twig19
-rw-r--r--assets/templates/intro_view.twig30
-rw-r--r--assets/themes/global.less143
-rw-r--r--src/classes/ContainerUtils.php20
-rw-r--r--src/controllers/TreeController.php12
-rw-r--r--src/decorators/ActionUrlDecorator.php2
-rw-r--r--src/decorators/BranchUrlDecorator.php13
-rw-r--r--src/decorators/Decorator.php24
-rw-r--r--src/decorators/FieldDecorator.php12
-rw-r--r--src/decorators/RedirectUrlDecorator.php6
-rw-r--r--src/decorators/UrlDecorator.php4
-rw-r--r--src/router.php32
-rw-r--r--src/xhtml/HTMLTableController.php2
25 files changed, 343 insertions, 413 deletions
diff --git a/assets/js/ac_insert_row.js b/assets/js/ac_insert_row.js
index c90d192e..3a9a3c3e 100644
--- a/assets/js/ac_insert_row.js
+++ b/assets/js/ac_insert_row.js
@@ -113,7 +113,7 @@ function openlist(e) {
};
jQuery.ajax({
- url: subfolder + '/src/views/acinsert.php?server=' + server,
+ url: subfolder + '/acinsert?server=' + server,
type: 'post',
data: datas,
dataType: 'html',
diff --git a/assets/js/jstree_events.js b/assets/js/jstree_events.js
index dfb3e3ef..651dc62d 100644
--- a/assets/js/jstree_events.js
+++ b/assets/js/jstree_events.js
@@ -6,17 +6,24 @@ window.jsTree = $('#lazy').jstree({
core: {
data: {
url: function (node) {
+ let leafs_url;
if (node.id === '#') {
- return stateObj.subfolder + '/src/views/browser?action=tree';
+ leafs_url = stateObj.subfolder + '/browser?action=tree';
} else {
- return node.original.url;
+ leafs_url = node.original.url;
}
+ console.log({ leafs_url });
+ return leafs_url;
},
},
},
});
$('#refreshTree').on('click', () => {
- window.jsTree.jstree('refresh');
+ if (window.jsTree.jstree) {
+ window.jsTree.jstree('refresh');
+ } else if (window.jsTree.refresh) {
+ window.jsTree.refresh();
+ }
});
if (parent.frames && parent.frames.detail) {
@@ -93,7 +100,11 @@ window.addEventListener(
if (data.reload_browser && globalThis.jsTree) {
try {
- jsTree.jstree('refresh');
+ if (window.jsTree.jstree) {
+ window.jsTree.jstree('refresh');
+ } else if (window.jsTree.refresh) {
+ window.jsTree.refresh();
+ }
} catch (err) {
console.warn(err);
}
diff --git a/assets/templates/browser.twig b/assets/templates/browser.twig
index a03f79a9..b7b7dbe6 100644
--- a/assets/templates/browser.twig
+++ b/assets/templates/browser.twig
@@ -1,24 +1,23 @@
<!DOCTYPE html>
<html xml:lang="{{lang.applocale}}" lang="{{lang.applocale}}" dir="{{lang.applangdir}}">
- <head data-headertemplate="{{headertemplate}}">
- {% include 'components/common_head.twig' %}
+ <head data-headertemplate="{{headertemplate}}">
+ {% include 'components/common_head.twig' %}
- <script src="{{subfolder}}/assets/vendor/jstree/jstree.min.js"></script>
- <style type="text/css">
- .refreshTree {
- position: absolute;
- right: 0;
- z-index: 1000;
- }
- </style>
- </head>
+ <script src="{{subfolder}}/assets/vendor/jstree/jstree.min.js"></script>
+ <style type="text/css">
+ .refreshTree {
+ position: absolute;
+ right: 0;
+ z-index: 1000;
+ }
+ </style>
+ </head>
- <body class="browser">
-{% include 'components/browser_body.twig' %}
- <script src="{{subfolder}}/assets/js/jstree_events.js">
- </script>
+ <body class="browser">
+ {% include 'components/browser_body.twig' %}
+ <script src="{{subfolder}}/assets/js/jstree_events.js"></script>
- </body>
+ </body>
-</html> \ No newline at end of file
+</html>
diff --git a/assets/templates/components/browser_body.twig b/assets/templates/components/browser_body.twig
index dbc532fa..82fb16d0 100644
--- a/assets/templates/components/browser_body.twig
+++ b/assets/templates/components/browser_body.twig
@@ -1,16 +1,14 @@
+<div dir="{{lang.applangdir}}">
- <div dir="{{lang.applangdir}}">
+ <div class="logo">
+ <a href="{{subfolder}}/" target="_parent">{{appName}}</a>
+ </div>
+ <div class="refreshTree" id="refreshTree">
+ <a href="#">
+ <img src="{{icon.Refresh}}" alt="{{lang.strrefresh}}" title="{{lang.strrefresh}}"/>
+ </a>
+ </div>
- <div class="logo">
- <a href="{{subfolder}}/" target="_parent">{{appName}}</a>
- </div>
- <div class="refreshTree" id="refreshTree">
- <a href="#">
- <img src="{{icon.Refresh}}" alt="{{lang.strrefresh}}" title="{{lang.strrefresh}}" />
- </a>
- </div>
-
- <div id="lazy" class="demo"></div>
-
- </div>
+ <div id="lazy" class="demo"></div>
+</div>
diff --git a/assets/templates/components/common_body.twig b/assets/templates/components/common_body.twig
index e88f382b..bf11b9e3 100644
--- a/assets/templates/components/common_body.twig
+++ b/assets/templates/components/common_body.twig
@@ -1,23 +1,16 @@
<body data-controller="{{ controller_name }}" class="{{ bodyClass }}" {{ onload }}>
- {% if includeJsTree %}
- <div class="flexbox_wrapper">
- <div id="masking_overlay"></div>
- <div id="browser_container">
+ <div class="flexbox_wrapper">
+ <div id="masking_overlay"></div>
+ <div id="browser_container">
- <div class="browser_container">
- <div class="browser" name="browser" id="browser">
- {% include 'components/browser_body.twig' %}
- <script src="{{ subfolder }}/assets/js/jstree_events.js"></script>
- </div>
- </div></div>
- <div class="splitter">
- </div>
- <div id="detail" class="detail_container" >
-
-
- {% else %}
- {#<iframe src="{{subfolder}}/src/views/browser" name="browser" id="browser" class="browser_container" frameborder="0" />
- <p>Your browser does not support iframes.</p>
- </iframe>#}
- {% endif %}
- \ No newline at end of file
+ <div class="browser_container">
+ <div class="browser" name="browser" id="browser">
+ {% include 'components/browser_body.twig' %}
+ <script src="{{ subfolder }}/assets/js/jstree_events.js"></script>
+ </div>
+ </div>
+ </div>
+ <div class="splitter"></div>
+ <div id="detail" class="detail_container">
+
+ \ No newline at end of file
diff --git a/assets/templates/components/common_head.twig b/assets/templates/components/common_head.twig
index 569033dc..ace59995 100644
--- a/assets/templates/components/common_head.twig
+++ b/assets/templates/components/common_head.twig
@@ -1,70 +1,53 @@
-<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
{% set development_assets = true %}
- <link rel="stylesheet" href="{{subfolder}}/assets/vendor/jstree/themes/phppgadmin/style.css" />
-<link rel="stylesheet" href="{{ subfolder }}/assets/themes/global.css" type="text/css" id="cssmain" />
-<link rel="stylesheet" href="{{ subfolder }}/assets/themes/{{ theme }}/global.css" type="text/css" id="csstheme" />
-<link rel="stylesheet" href="{{ subfolder }}/assets/vendor/jquery/jquery-ui.min.css" type="text/css" />
-<link rel="shortcut icon" href="{{ Favicon }}" type="image/vnd.microsoft.icon" />
-<link rel="icon" href="{{ Introduction }}" type="image/png" />
+<link rel="stylesheet" href="{{subfolder}}/assets/vendor/jstree/themes/phppgadmin/style.css"/>
+<link rel="stylesheet" href="{{ subfolder }}/assets/themes/global.css" type="text/css" id="cssmain"/>
+<link rel="stylesheet" href="{{ subfolder }}/assets/themes/{{ theme }}/global.css" type="text/css" id="csstheme"/>
+<link rel="stylesheet" href="{{ subfolder }}/assets/vendor/jquery/jquery-ui.min.css" type="text/css"/>
+<link rel="shortcut icon" href="{{ Favicon }}" type="image/vnd.microsoft.icon"/>
+<link rel="icon" href="{{ Introduction }}" type="image/png"/>
<script src="{{ subfolder }}/assets/vendor/jquery/jquery-3.4.1.min.js"></script>
<script src="{{ subfolder }}/assets/vendor/jquery/jquery-ui.min.js"></script>
-<script src="{{ subfolder }}/assets/vendor/jquery-resizable.js"></script>
- <script src="{{ subfolder }}/assets/vendor/jstree/jstree.min.js"></script>
- <meta name="header_template" value="{{headertemplate}}"/>
-{% if headertemplate == 'header_datatables.twig' %}
- <link rel="stylesheet" href="{{subfolder}}/assets/vendor/datatables/datatables.min.css" type="text/css" />
- <script src="{{subfolder}}/assets/vendor/datatables/datatables.min.js"></script>
-
-
- {% endif %}
- {% if headertemplate == 'header_select2.twig' %}
- <link rel="stylesheet" href="{{subfolder}}/assets/vendor/select2/css/select2.css" type="text/css" />
- <script src="{{subfolder}}/assets/vendor/select2/js/select2.full.min.js"></script>
- <script src="{{subfolder}}/assets/vendor/select2/js/i18n/{{lang.isolang}}.js"></script>
- {% endif %}
- {% if headertemplate == 'header_highlight.twig' %}
- <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" type="text/css" />
- <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
- {% endif %}
- <style type="text/css">
- .refreshTree { position: absolute; right: 0; z-index: 1000; }
+<style type="text/css">
+ .refreshTree {
+ position: absolute;
+ right: 0;
+ z-index: 1000;
+ }
.splitter {
- background: url("{{subfolder}}/assets/images/vsizegrip.png") center center no-repeat #b0bec5 !important
-
+ background: url("{{subfolder}}/assets/images/vsizegrip.png") center center no-repeat #b0bec5 !important
}
- </style>
+</style>
{{
script|raw
-}}<!-- prettier-ignore-start -->
+}}
+<!-- prettier-ignore-start -->
- <script>
+<script>
- globalThis.stateObj = {
- {% for key, value in params %}
- '{{key}}': "{{value}}",
- {% endfor %}
- dir: '{{lang.applangdir}}',
- in_test: '{{in_test}}',
- reload: '{{reload}}',
- method: '{{METHOD}}',
- subfolder:'{{subfolder}}',
- path:"{{path}}",
- query_string:"{{query_string}}",
- strconfdropcred:"{{lang.strconfdropcred}}",
- origin:globalThis.location.origin,
- url:"{{url}}",
- href:globalThis.location.href,
- guessedSubfolder:(''+globalThis.location.pathname).replace("/{{path}}",''),
- pathname:globalThis.location.pathname
- };
-
-
-
- </script>
+ globalThis.stateObj = {
+{% for key, value in params %}
+'{{ key }}' : "{{ value }}",
+{% endfor %}
+dir: '{{ lang.applangdir }}',
+in_test: '{{ in_test }}',
+reload: '{{ reload }}',
+method: '{{ METHOD }}',
+subfolder:'{{ subfolder }}',
+path:"{{ path }}",
+query_string:"{{ query_string }}",
+strconfdropcred:"{{ lang.strconfdropcred }}",
+origin: globalThis.location.origin,
+url:"{{ url }}",
+href: globalThis.location.href,
+guessedSubfolder: ('' + globalThis.location.pathname).replace("/ {{ path }}", ''),
+pathname: globalThis.location.pathname
+};
+</script>
<!-- prettier-ignore-end -->
<title data-headertemplate="{{ headertemplate }}" data-subfolder="{{ subfolder }}">
- {{ appName }}{{ title }}
+ {{ appName }}{{ title }}
</title>
diff --git a/assets/templates/components/tabs.twig b/assets/templates/components/tabs.twig
index 98b951ba..cc70c994 100644
--- a/assets/templates/components/tabs.twig
+++ b/assets/templates/components/tabs.twig
@@ -1,19 +1,21 @@
<div class="tabs" data-controller="{{controller_name}}">
-
- {% for tab in tabs %}
- <div class="tab {{tab.active}}">
- <a href="{{tab.tablink}}">
- {% if tab.iconurl %}
- <span class="icon"><img src="{{tab.iconurl}}" alt="{{tab.title}}" /></span>
- {% endif %}
- <span class="label">{{tab.title}}</span>
- </a> {% if tab.helpurl %}
- <a class="help" href="{{tab.helpurl}}" title="{{lang.strhelp}}" target="phppgadminhelp">{{lang.strhelpicon}}</a> {% endif %}
- </div>
+ {% for tab in tabs %}
+
+ <div class="tab {{tab.active}}">
+ <a href="{{tab.tablink}}">
+ {% if tab.iconurl %}
+ <span class="icon"><img src="{{tab.iconurl}}" alt="{{tab.title}}"/></span>
+ {% endif %}
+ <span class="label">{{tab.title}}</span>
+ </a>
+ {% if tab.helpurl %}
+ <a class="help" href="{{tab.helpurl}}" title="{{lang.strhelp}}" target="phppgadminhelp">{{lang.strhelpicon}}</a>
+ {% endif %}
+ </div>
+
+ {% endfor %}
- {% endfor %}
-
</div>
-<div class="clearfix">&nbsp;</div> \ No newline at end of file
+<div class="clearfix">&nbsp;</div>
diff --git a/assets/templates/components/trail.twig b/assets/templates/components/trail.twig
index 90530259..6353f92f 100644
--- a/assets/templates/components/trail.twig
+++ b/assets/templates/components/trail.twig
@@ -1,49 +1,52 @@
<div class="trail" data-controller="{{controller_name}}">
- <table style="float:left" class="trail_table">
- <tbody>
- <tr>
- {% for crumb in crumbs %}
+ <table style="float:left" class="trail_table">
+ <tbody>
+ <tr>
+ {% for crumb in crumbs %}
- <td class="crumb">
- <a href="{{crumb.url}}">
- <span class="icon">
- <img src="{{crumb.icon}}" alt="{{crumb.iconalt}}">
- </span>
- <span class="label">{{crumb.text}}</span>
- </a> {% if crumb.helpurl %}
- <a class="help" href="{{crumb.helpurl}}" title="{{lang.strhelp}}" target="phppgadminhelp">{{lang.strhelpicon}}</a> {% endif %} {{lang.strseparator}}
- </td>
- {% endfor %}
- </tr>
- </tbody>
- </table>
- {% if search_paths %}
- <table style="float:right" class="search_path">
- <tbody>
- <tr>
- <td class="crumb" style=" vertical-align: inherit;">
- {{lang.strsearchpath}}
- </td>
- {% for crumb in search_paths %}
-
- <td class="crumb">
- |
- <a href="{{crumb.url}}">
+ <td class="crumb">
+ <a href="{{crumb.url}}">
<span class="icon">
<img src="{{crumb.icon}}" alt="{{crumb.iconalt}}">
</span>
<span class="label">{{crumb.text}}</span>
</a>
+ {% if crumb.helpurl %}
+ <a class="help" href="{{crumb.helpurl}}" title="{{lang.strhelp}}" target="phppgadminhelp">{{lang.strhelpicon}}</a>
+ {% endif %}
+ {{lang.strseparator}}
+ </td>
+ {% endfor %}
+ </tr>
+ </tbody>
+ </table>
+ {% if search_paths %}
+ <table class="searchpath">
+ <tbody>
+ <tr>
+ <td class="crumb" style=" vertical-align: inherit;">
+ {{lang.strsearchpath}}
+ </td>
+ {% for crumb in search_paths %}
+
+ <td class="crumb">
+ |
+ <a href="{{crumb.url}}">
+ <span class="icon">
+ <img src="{{crumb.icon}}" alt="{{crumb.iconalt}}">
+ </span>
+ <span class="label">{{crumb.text}}</span>
+ </a>
- </td>
- {% endfor %}
- <td>
- &nbsp;&nbsp;
- </td>
- </tr>
- </tbody>
- </table>
- {% endif %}
+ </td>
+ {% endfor %}
+ <td>
+ &nbsp;&nbsp;
+ </td>
+ </tr>
+ </tbody>
+ </table>
+ {% endif %}
-</div> \ No newline at end of file
+</div>
diff --git a/assets/templates/deprecated.iframe_view.twig b/assets/templates/deprecated.iframe_view.twig
deleted file mode 100644
index ee8f4d10..00000000
--- a/assets/templates/deprecated.iframe_view.twig
+++ /dev/null
@@ -1,18 +0,0 @@
-{% include 'header.twig' %}
-
-<body class="flexbox_body {{lang.applangdir}}">
- <div class="flexbox_wrapper">
- <div id="masking_overlay"></div>
- <div id="browser_container">
-
- <iframe src="{{subfolder}}/src/views/browser" name="browser" id="browser" class="browser_container" frameborder="0" />
- <p>Your browser does not support iframes.</p>
- </iframe>
- </div>
-
- <iframe src="{{subfolder}}{{url}}" name="detail" id="detail" class="detail_container" frameborder="0" />
- <p>Your browser does not support iframes.</p>
- </iframe>
-
- </div>
- {% include 'footer_iframe.twig' %} \ No newline at end of file
diff --git a/assets/templates/footer.twig b/assets/templates/footer.twig
index 41b4f59f..012f1a43 100644
--- a/assets/templates/footer.twig
+++ b/assets/templates/footer.twig
@@ -1,35 +1,29 @@
{{script_footer|raw}}
- {% if print_bottom_link == true %}
-<a data-footertemplate="{{footer_template}}" href="#" class="bottom_link">{{lang.strgotoppage}}</a> {% endif %}
+{% if print_bottom_link == true %}
+ <a data-footertemplate="{{footer_template}}" href="#" class="bottom_link">{{lang.strgotoppage}}</a>
+{% endif %}
<script src="{{subfolder}}/assets/js/toplinks_behavior.js" type="text/javascript"></script>
<script src="{{subfolder}}/assets/js/footer_scripts.js" type="text/javascript"></script>
<script type="text/javascript">
-var dir = '{{lang.applangdir}}';
+ var dir = '{{ lang.applangdir }}';
window.onpopstate = function (event) {
- console.log('onpopstate', {
- state: event.state
- });
- if (event.state && event.state.realurl) {
- let ifr = document.getElementById('detail'),
- realUrl=event.state.realurl,
- detailLocation=ifr.contentWindow.location.href;
- //console.log({detailLocation,realUrl});
- ifr.contentWindow.location.replace(event.state.realurl);
- }
+console.log('onpopstate', {state: event.state});
+if (event.state && event.state.realurl) {
+let ifr = document.getElementById('detail'),
+realUrl = event.state.realurl,
+detailLocation = ifr.contentWindow.location.href;
+// console.log({detailLocation,realUrl});
+ifr.contentWindow.location.replace(event.state.realurl);
+}
};
-if('serviceWorker' in navigator) {
- navigator.serviceWorker.register('{{subfolder}}/assets/sw.dev.js').then(function(registration) {
- console.log('Service Worker Registered');
- }).catch(warn=>{
- console.warn(warn);
- })
+if ('serviceWorker' in navigator) {
+navigator.serviceWorker.register('{{ subfolder }}/assets/sw.dev.js').then(function (registration) {
+console.log('Service Worker Registered');
+}).catch(warn => {
+console.warn(warn);
+})
}
-</script>
-
-
-</body>
-
-</html> \ No newline at end of file
+</script></body></html>
diff --git a/assets/templates/footer_iframe.twig b/assets/templates/footer_iframe.twig
deleted file mode 100644
index a958348c..00000000
--- a/assets/templates/footer_iframe.twig
+++ /dev/null
@@ -1,26 +0,0 @@
-<script type="text/javascript">
-var dir = '{{lang.applangdir}}';
-
-window.onpopstate = function (event) {
- console.log('onpopstate', {
- state: event.state
- });
- if (event.state && event.state.realurl) {
- let ifr = document.getElementById('detail'),
- realUrl=event.state.realurl,
- detailLocation=ifr.contentWindow.location.href;
- //console.log({detailLocation,realUrl});
- ifr.contentWindow.location.replace(event.state.realurl);
- }
-};
-if('serviceWorker' in navigator) {
- navigator.serviceWorker.register('{{subdomain}}/assets/sw.dev.js').then(function(registration) {
- console.log('Service Worker Registered');
- }).catch(warn=>{
- console.warn(warn);
- })
-}
-</script>
-</body>
-
-</html> \ No newline at end of file
diff --git a/assets/templates/header.twig b/assets/templates/header.twig
index 040505ba..f233670c 100644
--- a/assets/templates/header.twig
+++ b/assets/templates/header.twig
@@ -1,8 +1,30 @@
<!DOCTYPE html>
-<html xml:lang="{{lang.applocale}}" lang="{{lang.applocale}}" dir="{{lang.applangdir}}">
+<html xml:lang="{{lang.applocale}}" lang="{{lang.applocale}}" dir="{{lang.applangdir}}">
- <head data-headertemplate="{{headertemplate}}">
- {% include 'components/common_head.twig' %}
+ <head data-headertemplate="{{headertemplate}}">
+ {% include 'components/common_head.twig' %}
- </head>
- \ No newline at end of file
+
+<script src="{{ subfolder }}/assets/vendor/jquery-resizable.js"></script>
+<script src="{{ subfolder }}/assets/vendor/jstree/jstree.min.js"></script>
+<meta name="header_template" value="{{headertemplate}}"/>
+{% if headertemplate == 'header_datatables.twig' %}
+ <link rel="stylesheet" href="{{subfolder}}/assets/vendor/datatables/datatables.min.css" type="text/css"/>
+ <script src="{{subfolder}}/assets/vendor/datatables/datatables.min.js"></script>
+
+
+{% endif %}
+{% if headertemplate == 'header_select2.twig' %}
+ <link rel="stylesheet" href="{{subfolder}}/assets/vendor/select2/css/select2.css" type="text/css"/>
+ <script src="{{subfolder}}/assets/vendor/select2/js/select2.full.min.js"></script>
+ <script src="{{subfolder}}/assets/vendor/select2/js/i18n/{{lang.isolang}}.js"></script>
+{% endif %}
+{% if headertemplate == 'header_highlight.twig' %}
+
+ <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/styles/default.min.css" type="text/css"/>
+ <script src="https://cdnjs.cloudflare.com/ajax/libs/highlight.js/9.12.0/highlight.min.js"></script>
+{% endif %}
+<script defer src="{{subfolder}}/assets/js/jstree_events.js"></script>
+
+ </head>
+</html>
diff --git a/assets/templates/header_sqledit.twig b/assets/templates/header_sqledit.twig
index 5203b56c..79bbc82a 100644
--- a/assets/templates/header_sqledit.twig
+++ b/assets/templates/header_sqledit.twig
@@ -1,17 +1,14 @@
<!DOCTYPE html>
<html xml:lang="{{lang.applocale}}" lang="{{lang.applocale}}" dir="{{dir}}">
- <head data-headertemplate="{{headertemplate}}">
+ <head data-headertemplate="{{headertemplate}}">
-
-
- {% include 'components/common_head.twig' %}
- <link href="{{subfolder}}/assets/vendor/codemirror/lib/codemirror.css" type="text/css" rel="stylesheet" />
- <script src="{{subfolder}}/assets/vendor/codemirror/lib/codemirror.js"></script>
- <script src="{{subfolder}}/assets/vendor/codemirror/addon/mode/loadmode.js"></script>
- <script src="{{subfolder}}/assets/vendor/codemirror/mode/meta.js"></script>
-
- </head>
+ {% include 'components/common_head.twig' %}
+ <link href="{{subfolder}}/assets/vendor/codemirror/lib/codemirror.css" type="text/css" rel="stylesheet"/>
+ <script src="{{subfolder}}/assets/vendor/codemirror/lib/codemirror.js"></script>
+ <script src="{{subfolder}}/assets/vendor/codemirror/addon/mode/loadmode.js"></script>
+ <script src="{{subfolder}}/assets/vendor/codemirror/mode/meta.js"></script>
- \ No newline at end of file
+ </head>
+</html>
diff --git a/assets/templates/intro_view.twig b/assets/templates/intro_view.twig
index 9b69abec..b9161db9 100644
--- a/assets/templates/intro_view.twig
+++ b/assets/templates/intro_view.twig
@@ -1,23 +1,23 @@
{% include 'header.twig' %}
<body class="flexbox_body {{ lang.applangdir }}">
-
- <div class="flexbox_wrapper">
- <div id="masking_overlay"></div>
- <div id="browser_container">
- <div class="browser_container">
- <div class="browser" name="browser" id="browser">
- {% include 'components/browser_body.twig' %}
- <script src="{{subfolder}}/assets/js/jstree_events.js"> </script>
- </div>
- </div>
- </div>
+ <div class="flexbox_wrapper">
+ <div id="masking_overlay"></div>
+ <div id="browser_container">
+ <div class="browser_container">
+ <div class="browser" name="browser" id="browser">
+ {% include 'components/browser_body.twig' %}
+
+
+ </div>
+ </div>
+ </div>
+
+ <iframe src="{{ subfolder }}{{ url }}" name="detail" id="detail" class="detail_container" frameborder="0"/>
+ </div>
+ {% include 'footer_iframe.twig' %}
- <iframe src="{{ subfolder }}{{ url }}" name="detail" id="detail" class="detail_container" frameborder="0" />
- </div>
- {% include 'footer_iframe.twig' %}
-
</body>
diff --git a/assets/themes/global.less b/assets/themes/global.less
index 7ea0b9ef..129446db 100644
--- a/assets/themes/global.less
+++ b/assets/themes/global.less
@@ -47,19 +47,19 @@ html {
padding-bottom: 20px;
div.tabs {
display: flex;
- /* margin-top: 58px; */
- /* width: 100%; */
- flex: 2 1 1500px;
- flex-direction: row;
- position: relative;
- right: 0;
- top: 60px;
- .tab {
- flex: 1 1 auto;
- flex-direction: column;
- }
+ /* margin-top: 58px; */
+ /* width: 100%; */
+ flex: 2 1 1500px;
+ flex-direction: row;
+ position: relative;
+ right: 0;
+ top: 60px;
+ .tab {
+ flex: 1 1 auto;
+ flex-direction: column;
+ }
}
- & > table.tabs {
+ & > table.tabs {
position: fixed;
top: 58px;
z-index: 50;
@@ -76,9 +76,7 @@ html {
}
table {
min-width: calc(100vw - 370px);
-
-
- &#data {
+ &.searchpath &#data {
td {
white-space: nowrap;
@@ -153,7 +151,6 @@ html {
color: #fff !important;
}
}
-
}
#detail.detail_container {
padding-top: 0 !important;
@@ -169,17 +166,16 @@ html {
margin-right: -10px;
}
}
- .topbar {
- position: fixed;
- .toplink {
- width: 160px;
- margin-right: 110px;
- }
- }
- .trail {
- position: fixed;
+ .topbar {
+ position: fixed;
+ .toplink {
+ width: 160px;
+ margin-right: 110px;
}
-
+ }
+ .trail {
+ position: fixed;
+ }
}
.navlink {
li {
@@ -233,58 +229,56 @@ html {
margin: 0;
.flexbox_wrapper {
- height: 100%;
+ height: 100%;
margin: 0;
-
- display: flex;
- flex-direction: row;
- border: 1px solid silver;
- overflow: hidden;
-
- /* avoid browser level touch actions */
- xtouch-action: none;
-
- #browser_container {
- flex: 0 0 auto;
- /* only manually resize */
- //padding: 10px;
- width: 250px;
- min-height: 200px;
- min-width: 150px;
- white-space: nowrap;
- // background: #838383;
- color: white;
-
- .refreshTree {
- position: absolute;
- left: 200px;
- z-index: 1000;
- padding: 5px;
- width: 40px;
-
- }
+ display: flex;
+ flex-direction: row;
+ border: 1px solid silver;
+ overflow: hidden;
+
+ /* avoid browser level touch actions */
+ xtouch-action: none;
+
+ #browser_container {
+ flex: 0 0 auto;
+ /* only manually resize */
+ //padding: 10px;
+ width: 250px;
+ min-height: 200px;
+ min-width: 150px;
+ white-space: nowrap;
+ // background: #838383;
+ color: white;
+
+ .refreshTree {
+ position: absolute;
+ left: 200px;
+ z-index: 1000;
+ padding: 5px;
+ width: 40px;
}
+ }
- .splitter {
- flex: 0 0 auto;
- width: 8px;
-
- min-height: 200px;
- cursor: col-resize;
- }
+ .splitter {
+ flex: 0 0 auto;
+ width: 8px;
- #detail_container {
- flex: 1 1 auto;
- /* resizable */
- padding: 10px;
- width: 100%;
- min-height: 200px;
- min-width: 200px;
- background: #eee;
- }
+ min-height: 200px;
+ cursor: col-resize;
+ }
+
+ #detail_container {
+ flex: 1 1 auto;
+ /* resizable */
+ padding: 10px;
+ width: 100%;
+ min-height: 200px;
+ min-width: 200px;
+ background: #eee;
}
- /*
+ }
+ /*
& > .detail_container {
height: 100%;
@@ -295,7 +289,7 @@ html {
float: left;
flex: 1 1 1300px;
}*/
-/*
+ /*
& > #browser_container {
height: 100%;
margin: 0px;
@@ -328,7 +322,6 @@ html {
}
}
*/
-
&.rtl {
.flexbox_wrapper {
@@ -582,6 +575,8 @@ html {
.searchpath {
padding: 5px;
clear: both;
+ min-width:unset;
+ float:left;
}
.CodeMirror {
diff --git a/src/classes/ContainerUtils.php b/src/classes/ContainerUtils.php
index 88e3b394..e07cceb5 100644
--- a/src/classes/ContainerUtils.php
+++ b/src/classes/ContainerUtils.php
@@ -168,10 +168,10 @@ class ContainerUtils extends Container implements ContainerInterface
// if server_id isn't set, then you will be redirected to intro
if (null === $container->request->getQueryParam('server')) {
- $destinationurl = $this->subFolder. '/src/views/intro';
+ $destinationurl = $this->subFolder. '/intro';
} else {
// otherwise, you'll be redirected to the login page for that server;
- $destinationurl = $this->subFolder. '/src/views/login' . ($query_string ? '?' . $query_string : '');
+ $destinationurl = $this->subFolder. '/login' . ($query_string ? '?' . $query_string : '');
}
return $destinationurl;
@@ -216,13 +216,10 @@ class ContainerUtils extends Container implements ContainerInterface
$url = $container->misc->getLastTabURL($subject) ?? ['url' => 'alldb', 'urlvars' => ['subject' => 'server']];
$destinationurl = $this->getRedirectUrl();
- if (!isset($_server_info['username'])) {
+ if (!isset($_server_info['username'])||!\is_array($url)) {
return $destinationurl;
}
- if (!\is_array($url)) {
- return $this->getRedirectUrl($subject);
- }
$this->addFlash($url, 'getLastTabURL for ' . $subject);
// Load query vars into superglobal arrays
if (isset($url['urlvars'])) {
@@ -236,12 +233,11 @@ class ContainerUtils extends Container implements ContainerInterface
$_GET = \array_merge($_GET, $urlvars);
}
$actionurl = Decorator::actionurl($url['url'], $_GET);
- $destinationurl = $actionurl->value($_GET);
-
- return $this->subFolder.\str_replace('views/?', \sprintf(
- 'views/%s?',
- $subject
- ), $destinationurl);
+ $destinationurl =str_replace($this->subFolder,'', $actionurl->value($_GET));
+if(strpos($destinationurl,$subject)===0) {
+ $destinationurl=$this->subFolder.'/'.$destinationurl;
+}
+ return $destinationurl;
}
/**
diff --git a/src/controllers/TreeController.php b/src/controllers/TreeController.php
index 4f7e6103..fbe4d0c2 100644
--- a/src/controllers/TreeController.php
+++ b/src/controllers/TreeController.php
@@ -154,8 +154,8 @@ class TreeController extends BaseController
'children' => true,
'icon' => \containerInstance()->subFolder . '/assets/images/themes/default/Servers.png',
'state' => ['opened' => true],
- 'a_attr' => ['href' => \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/servers')],
- 'url' => \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/servers?action=tree'),
+ 'a_attr' => ['href' =>'servers'],
+ 'url' => \containerInstance()->subFolder . ('/servers?action=tree'),
'text' => 'Servers',
];
} elseif (0 < \count($treedata)) {
@@ -167,7 +167,7 @@ class TreeController extends BaseController
}
$href=Decorator::get_sanitized_value($attrs['action'], $rec);
if ($href) {
- $href = \str_replace('//', '/', \containerInstance()->subFolder . $href);
+ $href = \str_replace('//', '/', $href);
}
$tree = [
@@ -182,9 +182,9 @@ class TreeController extends BaseController
];
$url = Decorator::get_sanitized_value($attrs['branch'], $rec);
- if ($url && false === \mb_strpos($url, '/src/views')) {
- $url = \str_replace('//', '/', \containerInstance()->subFolder . '/src/views/' . $url);
- }
+
+ $url = \str_replace('/src/views/', '/', $url);
+
if ($url) {
$tree['url'] = $url;
diff --git a/src/decorators/ActionUrlDecorator.php b/src/decorators/ActionUrlDecorator.php
index 3ffed5fc..5eff0e8f 100644
--- a/src/decorators/ActionUrlDecorator.php
+++ b/src/decorators/ActionUrlDecorator.php
@@ -41,6 +41,6 @@ class ActionUrlDecorator extends Decorator
}
}
- return /*\containerInstance()->subFolder . '/*/'/src/views/' . \str_replace('.php', '', $url);
+ return \str_replace('.php', '', containerInstance()->subFolder.'/'.$url);
}
}
diff --git a/src/decorators/BranchUrlDecorator.php b/src/decorators/BranchUrlDecorator.php
index c07e04cb..f28ad2be 100644
--- a/src/decorators/BranchUrlDecorator.php
+++ b/src/decorators/BranchUrlDecorator.php
@@ -39,14 +39,13 @@ class BranchUrlDecorator extends Decorator
}
}
- if (false === \mb_strpos($url, '/src/views')) {
- $url = \str_replace('//', '/', '/src/views/' . $url);
- }
+ $url = \str_replace('/src/views/', '/', $url);
+
- if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (0 !== \mb_strpos($url, \containerInstance()->subFolder))) {
- $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url);
- }
+ //if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (0 !== \mb_strpos($url, \containerInstance()->subFolder))) {
+ // $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url);
+ //}
- return \str_replace('.php', '', $url);
+ return \str_replace('.php', '', containerInstance()->subFolder.'/'.$url);
}
}
diff --git a/src/decorators/Decorator.php b/src/decorators/Decorator.php
index 14bddc0e..347cf9b6 100644
--- a/src/decorators/Decorator.php
+++ b/src/decorators/Decorator.php
@@ -109,10 +109,10 @@ class Decorator
// use an ArrayMergeDecorator to have them merged
// at value evaluation time.
if (2 < \func_num_args()) {
- $v = \func_get_args();
- \array_shift($v);
+ $urlvalue = \func_get_args();
+ \array_shift($urlvalue );
- return new BranchUrlDecorator($base, new ArrayMergeDecorator($v));
+ return new BranchUrlDecorator($base, new ArrayMergeDecorator($urlvalue));
}
return new BranchUrlDecorator($base, $vars);
@@ -128,10 +128,10 @@ class Decorator
// use an ArrayMergeDecorator to have them merged
// at value evaluation time.
if (2 < \func_num_args()) {
- $v = \func_get_args();
- \array_shift($v);
+ $urlvalue = \func_get_args();
+ \array_shift($urlvalue);
- return new ActionUrlDecorator($base, new ArrayMergeDecorator($v));
+ return new ActionUrlDecorator($base, new ArrayMergeDecorator($urlvalue));
}
return new ActionUrlDecorator($base, $vars);
@@ -147,10 +147,10 @@ class Decorator
// use an ArrayMergeDecorator to have them merged
// at value evaluation time.
if (2 < \func_num_args()) {
- $v = \func_get_args();
- \array_shift($v);
+ $urlvalue = \func_get_args();
+ \array_shift($urlvalue);
- return new RedirectUrlDecorator($base, new ArrayMergeDecorator($v));
+ return new RedirectUrlDecorator($base, new ArrayMergeDecorator($urlvalue));
}
return new RedirectUrlDecorator($base, $vars);
@@ -167,10 +167,10 @@ class Decorator
// at value evaluation time.
if (2 < \func_num_args()) {
- $v = \func_get_args();
- $base = \array_shift($v);
+ $urlvalue = \func_get_args();
+ $base = \array_shift($urlvalue );
- return new UrlDecorator($base, new ArrayMergeDecorator($v));
+ return new UrlDecorator($base, new ArrayMergeDecorator($urlvalue ));
}
return new UrlDecorator($base, $vars);
diff --git a/src/decorators/FieldDecorator.php b/src/decorators/FieldDecorator.php
index 9ded828c..325455fc 100644
--- a/src/decorators/FieldDecorator.php
+++ b/src/decorators/FieldDecorator.php
@@ -8,19 +8,19 @@ namespace PHPPgAdmin\Decorators;
class FieldDecorator extends Decorator
{
- public function __construct($fieldName, $default = null)
+ public function __construct($fieldName, $defaultValue = null)
{
- $this->f = $fieldName;
+ $this->fieldName = $fieldName;
- $this->d = $default;
+ $this->defaultValue = $defaultValue;
}
public function value($fields)
{
- if (isset($fields[$this->f])) {
- return Decorator::get_sanitized_value($fields[$this->f], $fields);
+ if (isset($fields[$this->fieldName])) {
+ return Decorator::get_sanitized_value($fields[$this->fieldName], $fields);
}
- return $this->d;
+ return $this->defaultValue;
}
}
diff --git a/src/decorators/RedirectUrlDecorator.php b/src/decorators/RedirectUrlDecorator.php
index 3ff70003..47077623 100644
--- a/src/decorators/RedirectUrlDecorator.php
+++ b/src/decorators/RedirectUrlDecorator.php
@@ -44,10 +44,8 @@ class RedirectUrlDecorator extends Decorator
$sep = '&';
}
}
-
- if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, \containerInstance()->subFolder))) {
- // $url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url);
- }
+
+ $url = \str_replace('//', '/', containerInstance()->subFolder. '/' . $url);
return \str_replace('.php', '', $url);
}
diff --git a/src/decorators/UrlDecorator.php b/src/decorators/UrlDecorator.php
index 2051d1b8..cc22a4a1 100644
--- a/src/decorators/UrlDecorator.php
+++ b/src/decorators/UrlDecorator.php
@@ -37,9 +37,9 @@ class UrlDecorator extends Decorator
}
}
- if ('' !== containerInstance()->subFolder && (0 === \mb_strpos($url, '/')) && (false === \mb_strpos($url, \containerInstance()->subFolder))) {
+
$url = \str_replace('//', '/', \containerInstance()->subFolder . '/' . $url);
- }
+
return $url;
}
diff --git a/src/router.php b/src/router.php
index c2409c5d..9db39b6f 100644
--- a/src/router.php
+++ b/src/router.php
@@ -117,7 +117,9 @@ $app->get('/redirect[/{subject}]', function (
) {
$subject = (isset($args['subject'])) ? $args['subject'] : 'root';
$destinationurl = $this->getDestinationWithLastTab($subject);
- return $response->withStatus(302)->withHeader('Location', $destinationurl);
+ $cleanDestination=($this->subFolder.'/'. $destinationurl);
+
+ return $response->withStatus(302)->withHeader('Location',$cleanDestination);
});
ini_set('display_errors','on');
@@ -142,28 +144,9 @@ $app->map(['GET', 'POST'], '/src/views/{subject}', function (
array $args
) {
$subject = $args['subject'];
-
- if ('server' === $subject) {
- $subject = 'servers';
- }
- $_server_info = $this->misc->getServerInfo();
-
- $safe_subjects = ('servers' === $subject || 'intro' === $subject || 'browser' === $subject);
-
- if (null === $this->misc->getServerId() && !$safe_subjects) {
- return $response->withStatus(302)->withHeader('Location', $this->subFolder . '/src/views/servers');
- }
-
- if (!isset($_server_info['username']) && 'login' !== $subject && !$safe_subjects) {
- $destinationurl = $this->subFolder . '/src/views/login?server=' . $this->misc->getServerId();
-
- return $response->withStatus(302)->withHeader('Location', $destinationurl);
- }
-
- $className = '\PHPPgAdmin\Controller\\' . \ucfirst($subject) . 'Controller';
- $controller = new $className($this);
-
- return $controller->render();
+ $nextPath=$this->subFolder.'/'. $subject;
+
+return $response->withStatus(302)->withHeader('Location',$nextPath);
});
$app->get('/{subject:\w+}[/{server_id}]', function (
@@ -173,7 +156,8 @@ $app->get('/{subject:\w+}[/{server_id}]', function (
) {
$subject = $args['subject'] ?? 'intro';
$server_id = $args['server_id'] ?? $request->getQueryParam('server');
- //ddd($subject, $server_id);
+ $query_params=$request->getQueryParams();
+
$_server_info = $this->misc->getServerInfo();
//$this->utils->prtrace($_server_info);
diff --git a/src/xhtml/HTMLTableController.php b/src/xhtml/HTMLTableController.php
index 7ab03023..e26c29c4 100644
--- a/src/xhtml/HTMLTableController.php
+++ b/src/xhtml/HTMLTableController.php
@@ -330,7 +330,7 @@ class HTMLTableController extends HTMLController
if (null !== $val) {
if (isset($column['url'])) {
- $column['url']=str_replace(sprintf('%s%s',$this->container->subFolder,$this->container->subFolder),$this->container->subFolder,$column['url']??'');
+ $column['url']=str_replace(sprintf('%s%s',$this->container->subFolder,$this->container->subFolder),$this->container->subFolder.'/',$column['url']??'');
$tbody_html .= "<a href=\"{$column['url']}";
$tbody_html .= $this->printUrlVars($column['vars'], $tabledata->fields, false);
$tbody_html .= '">';