"._('Driver').""._('Description').""._('State').""._('Type').""._('Modprobe.d config file').""; $html .= ""; ksort($arrModules); foreach($arrModules as $modname => $module) { if ($modname == "") continue; if (is_file("/boot/config/modprobe.d/$modname.conf")) { $modprobe = file_get_contents("/boot/config/modprobe.d/$modname.conf"); $state = strpos($modprobe, "blacklist"); $modprobe = explode(PHP_EOL,$modprobe); if($state !== false) {$state = "Disabled";} else $state="Custom"; $module['state'] = $state; $module['modprobe'] = $modprobe; } else { if (is_file("/etc/modprobe.d/$modname.conf")) { $modprobe = file_get_contents("/etc/modprobe.d/$modname.conf"); $state = strpos($modprobe, "blacklist"); $modprobe = explode(PHP_EOL,$modprobe); if($state !== false) {$state = "Disabled";} else $state="System"; $module['state'] = $state; $module['modprobe'] = $modprobe; } } $html .= ""; if ($supportpage) { if ($module['support'] == false) { $supporthtml = ""; } else { $supporturl = $module['supporturl']; $pluginname = $module['plugin']; $supporthtml = ""; } } if (!empty($module["version"])) $version = " (".$module["version"].")"; else $version = ""; $html .= "$modname$version$supporthtml"; $html .= "{$module['description']}{$module['state']}{$module['type']}"; $text = ""; if (is_array($module["modprobe"]) && count($module["modprobe"])) { $text = implode("\n",$module["modprobe"]); $hidden = ($module['state'] == "System") ? "hidden" : ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; } else { $html .= ""; $html .= ""; $html .= ""; $html .= ""; $html .= ""; } } $html .= ""; $rtn = array(); $rtn['html'] = $html; if ($init !== false) {$init = true; unlink($sysdrvinit);} $rtn['init'] = $init; echo json_encode($rtn); break; case "update": $conf = $_POST['conf']; $module = $_POST['module']; if ($conf == "") $error = unlink("/boot/config/modprobe.d/$module.conf"); else $error = file_put_contents("/boot/config/modprobe.d/$module.conf",$conf); getmodules($module); $return = $arrModules[$module]; $return['supportpage'] = $supportpage; if (is_array($return["modprobe"]))$return["modprobe"] = implode("\n",$return["modprobe"]); if ($error !== false) $return["error"] = false; else $return["error"] = true; echo json_encode($return); break; } ?>