diff --git a/Code/Lib/Apps.php b/Code/Lib/Apps.php index 2e6f40e86..49dc7de6c 100644 --- a/Code/Lib/Apps.php +++ b/Code/Lib/Apps.php @@ -362,6 +362,7 @@ class Apps 'Connections' => t('Connections'), 'Content Filter' => t('Content Filter'), 'Content Import' => t('Content Import'), + 'Custom SQL' => t('Custom SQL'), 'Directory' => t('Directory'), 'Drafts' => t('Drafts'), 'Events' => t('Events'), diff --git a/Code/Module/Dev/Customsql.php b/Code/Module/Admin/Customsql.php similarity index 72% rename from Code/Module/Dev/Customsql.php rename to Code/Module/Admin/Customsql.php index 8bd2c1f3d..6d225f84c 100644 --- a/Code/Module/Dev/Customsql.php +++ b/Code/Module/Admin/Customsql.php @@ -1,9 +1,10 @@ ' . $text . ''; + } + $query = [ 'query', 'Enter an SQL query', '', '' ]; $ok = [ 'ok', 'OK to show all results?', '', '' ]; @@ -27,13 +33,13 @@ class Customsql '$title' => t('Custom SQL query'), '$warn' => t('If you do not know exactly what you are doing, please leave this page now.'), '$query' => $query, - '$form_security_token' => get_form_security_token('dev_customsql'), + '$form_security_token' => get_form_security_token('admin_customsql'), '$ok' => $ok, '$submit' => t('Submit') ]); if (isset($_REQUEST['query']) && $_REQUEST['query']) { - check_form_security_token_redirectOnErr('/dev/customsql', 'dev_customsql'); + check_form_security_token_redirectOnErr('/admin/customsql', 'admin_customsql'); $o .= EOL . EOL; $r = q($_REQUEST['query']); if (is_array($r) && count($r) > 500 && !isset($_REQUEST['ok'])) { diff --git a/app/customsql.apd b/app/customsql.apd new file mode 100644 index 000000000..d1381378f --- /dev/null +++ b/app/customsql.apd @@ -0,0 +1,6 @@ +version: 1 +url: $baseurl/admin/customsql +requires: admin +name: Custom SQL +photo: icon:mysql +categories: System,nav_featured_app diff --git a/view/tpl/customsql.tpl b/view/tpl/customsql.tpl index d203fac9d..7b080b8c6 100755 --- a/view/tpl/customsql.tpl +++ b/view/tpl/customsql.tpl @@ -3,7 +3,7 @@
{{$warn}}


-
+ {{include file="field_textarea.tpl" field=$query}} {{include file="field_checkbox.tpl" field=$ok}}