Skip to content

Commit c772b18

Browse files
authored
Merge pull request #1035 from Anisan/patch-3
find data in modules
2 parents 324a8aa + 175fe30 commit c772b18

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

modules/inc_panel_ajax.php

+18-1
Original file line numberDiff line numberDiff line change
@@ -261,6 +261,23 @@ function evalConsole($code, $print = 0) {
261261
$res .= '<div class="searchHover"><span class="label" style="background-color: #af81ff;">GPS</span> <a href="/panel/app_gpstrack/action_' . $devices[$i]['ID'] . '.html">' . $devices[$i]['TITLE'] . ' - ' . $devices[$i]['NAME'] . '</a></div>';
262262
}
263263
}
264+
265+
// find in modules
266+
$items = SQLSelect("SELECT * FROM project_modules");
267+
foreach($items as $item) {
268+
$module_name = $item['NAME'];
269+
$module_file = DIR_MODULES.$module_name.'/'.$module_name.'.class.php';
270+
if (file_exists($module_file)) {
271+
include_once($module_file);
272+
$module = new $module_name;
273+
if (method_exists($module,'findData')) {
274+
$result = $module->findData($title);
275+
foreach($result as $data) {
276+
$res .= '<div class="searchHover"><span class="label" style="background-color: #5cb85c;">&nbsp;'.$item['TITLE'].'</span>'.$data.'</div>';
277+
}
278+
}
279+
}
280+
}
264281

265282
//todo: webvars
266283
//todo: patterns
@@ -302,4 +319,4 @@ function evalConsole($code, $print = 0) {
302319
}
303320
exit;
304321

305-
?>
322+
?>

0 commit comments

Comments
 (0)