Skip to content

Commit

Permalink
Merge pull request #1035 from Anisan/patch-3
Browse files Browse the repository at this point in the history
find data in modules
  • Loading branch information
sergejey committed May 21, 2022
2 parents 324a8aa + 175fe30 commit c772b18
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion modules/inc_panel_ajax.php
Expand Up @@ -261,6 +261,23 @@ function evalConsole($code, $print = 0) {
$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>';
}
}

// find in modules
$items = SQLSelect("SELECT * FROM project_modules");
foreach($items as $item) {
$module_name = $item['NAME'];
$module_file = DIR_MODULES.$module_name.'/'.$module_name.'.class.php';
if (file_exists($module_file)) {
include_once($module_file);
$module = new $module_name;
if (method_exists($module,'findData')) {
$result = $module->findData($title);
foreach($result as $data) {
$res .= '<div class="searchHover"><span class="label" style="background-color: #5cb85c;">&nbsp;'.$item['TITLE'].'</span>'.$data.'</div>';
}
}
}
}

//todo: webvars
//todo: patterns
Expand Down Expand Up @@ -302,4 +319,4 @@ function evalConsole($code, $print = 0) {
}
exit;

?>
?>

0 comments on commit c772b18

Please sign in to comment.