From 921224268cfa37928c226efe51cafa675658f340 Mon Sep 17 00:00:00 2001
From: ftimme <ft@falkotimme.com>
Date: Fri, 07 Sep 2012 06:58:18 -0400
Subject: [PATCH] - Added database users and directive snippets to global search.
---
interface/web/sites/form/database_user.tform.php | 2 +-
interface/web/admin/form/directive_snippets.tform.php | 12 ++++++++++--
interface/web/dashboard/ajax_get_json.php | 6 ++++++
interface/web/js/jquery.ispconfigsearch.js | 2 +-
4 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/interface/web/admin/form/directive_snippets.tform.php b/interface/web/admin/form/directive_snippets.tform.php
index a8b43b5..5337084 100644
--- a/interface/web/admin/form/directive_snippets.tform.php
+++ b/interface/web/admin/form/directive_snippets.tform.php
@@ -29,6 +29,11 @@
Hint:
The ID field of the database table is not part of the datafield definition.
The ID field must be always auto incement (int or bigint).
+
+ Search:
+ - searchable = 1 or searchable = 2 include the field in the search
+ - searchable = 1: this field will be the title of the search result
+ - searchable = 2: this field will be included in the description of the search result
*/
@@ -69,13 +74,15 @@
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '255',
+ 'searchable' => 1
),
'type' => array (
'datatype' => 'VARCHAR',
'formtype' => 'SELECT',
'default' => '',
'value' => array('apache' => 'Apache','nginx' => 'nginx','php' => 'PHP'),
+ 'searchable' => 2
),
'snippet' => array (
'datatype' => 'TEXT',
@@ -83,7 +90,8 @@
'default' => '',
'value' => '',
'width' => '30',
- 'maxlength' => '255'
+ 'maxlength' => '255',
+ 'searchable' => 2
),
'active' => array (
'datatype' => 'VARCHAR',
diff --git a/interface/web/dashboard/ajax_get_json.php b/interface/web/dashboard/ajax_get_json.php
index b134a84..9aa22ff 100644
--- a/interface/web/dashboard/ajax_get_json.php
+++ b/interface/web/dashboard/ajax_get_json.php
@@ -88,6 +88,9 @@
*/
$result[] = _search('sites', 'database');
+ // database users
+ $result[] = _search('sites', 'database_user');
+
// email domains
$result[] = _search('mail', 'mail_domain');
@@ -132,6 +135,9 @@
// virtual machines ip addresses
$result[] = _search('vm', 'openvz_ip');
+
+ // directive snippets
+ $result[] = _search('admin', 'directive_snippets');
$json = $app->functions->json_encode($result);
}
diff --git a/interface/web/js/jquery.ispconfigsearch.js b/interface/web/js/jquery.ispconfigsearch.js
index 9e443a3..7a8115c 100644
--- a/interface/web/js/jquery.ispconfigsearch.js
+++ b/interface/web/js/jquery.ispconfigsearch.js
@@ -1,5 +1,5 @@
/*
-Copyright (c) 2012, ISPConfig UG
+Copyright (c) 2012, ISPConfig UG (haftungsbeschränkt)
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
diff --git a/interface/web/sites/form/database_user.tform.php b/interface/web/sites/form/database_user.tform.php
index 9716701..7e84f1c 100644
--- a/interface/web/sites/form/database_user.tform.php
+++ b/interface/web/sites/form/database_user.tform.php
@@ -89,7 +89,7 @@
'value' => '',
'width' => '30',
'maxlength' => '255',
- 'searchable' => 2
+ 'searchable' => 1
),
'database_password' => array (
'datatype' => 'VARCHAR',
--
Gitblit v1.9.1