/** * Get our icon path + filename * @global type $controller * @return string Path to the icon file */ static function getModuleIcon() { global $controller; $module_icon = "modules/" . $controller->GetControllerRequest('URL', 'module') . "/assets/icon.png"; // Allows the theme to change the WHMCS icon // Credits & Source: Ron-e https://github.com/sentora/sentora-core/commit/b88b1295db03cff536b33eebb865f0fa69e783ce if (file_exists(ui_tpl_assetfolderpath::Template() . 'images/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png')) { $module_icon = ui_tpl_assetfolderpath::Template() . 'images/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png'; } elseif (file_exists(ui_tpl_assetfolderpath::Template() . 'img/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png')) { $module_icon = ui_tpl_assetfolderpath::Template() . 'img/' . $controller->GetControllerRequest('URL', 'module') . '/assets/icon.png'; } return $module_icon; }
public static function getServices() { global $controller; if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/up.gif') && file_exists(ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/down.gif')) { $iconpath = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/'; } else { $iconpath = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/'; } $line = "<h2>" . ui_language::translate("Checking status of services...") . "</h2>"; $line .= "<table>"; $status = fs_director::CheckForEmptyValue(sys_monitoring::PortStatus($PortNum)); $line .= '<tr><th>HTTP</th><td>' . module_controller::status_port(80, $iconpath) . '</td></tr>'; $line .= '<tr><th>FTP</th><td>' . module_controller::status_port(21, $iconpath) . '</td></tr>'; $line .= '<tr><th>SMTP</th><td>' . module_controller::status_port(25, $iconpath) . '</td></tr>'; $line .= '<tr><th>POP3</th><td>' . module_controller::status_port(110, $iconpath) . '</td></tr>'; $line .= '<tr><th>IMAP</th><td>' . module_controller::status_port(143, $iconpath) . '</td></tr>'; $line .= '<tr><th>MySQL</th><td>' . module_controller::status_port(3306, $iconpath) . '</td></tr>'; $line .= '<tr><th>DNS</th><td>' . module_controller::status_port(53, $iconpath) . '</td></tr>'; $line .= '</table>'; $line .= '<br><h2>' . ui_language::translate('Server Uptime') . '</h2>'; $line .= ui_language::translate('Uptime') . ": " . sys_monitoring::ServerUptime(); return $line; }
private static function DisplayChart($name, $used, $maximum) { global $controller; if ($maximum < 0) { //-1 = unlimited if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) { $res = '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } else { $res = '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } } else { $free = max($maximum - $used, 0); $res = '<img src="etc/lib/pChart2/MADmin/z3DPie.php?score=' . $free . '::' . $used . '&imagesize=240::190&chartsize=120::90&radius=100' . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&legendsize=10::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>'; } return '<h2>' . ui_language::translate($name) . '</h2>' . $res; }
static function getFTPUsagepChart() { global $controller; $currentuser = ctrl_users::GetUserDetail(); $maximum = $currentuser['ftpaccountsquota']; if ($maximum < 0) { //-1 = unlimited if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) { return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } else { return '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } } else { $used = ctrl_users::GetQuotaUsages('ftpaccounts', $currentuser['userid']); $free = max($maximum - $used, 0); return '<img src="etc/lib/pChart2/MADmin/z3DPie.php?score=' . $free . '::' . $used . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&imagesize=240::190&chartsize=120::90&radius=100&legendsize=150::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>'; } }
static function getForwardUsagepChart() { $currentuser = ctrl_users::GetUserDetail(); $maximum = $currentuser['forwardersquota']; if ($maximum < 0) { //-1 = unlimited return '<img src="' . ui_tpl_assetfolderpath::Template() . 'images/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } else { $used = ctrl_users::GetQuotaUsages('forwarders', $currentuser['userid']); $free = max($maximum - $used, 0); return '<img src="etc/lib/pChart2/sentora/z3DPie.php?score=' . $free . '::' . $used . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&imagesize=240::190&chartsize=120::90&radius=100&legendsize=150::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>'; } }
static function getMysqlUsagepChart() { return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; }
private static function DisplayChart($name, $used, $maximum) { if ($maximum < 0) { //-1 = unlimited $res = '<img src="' . ui_tpl_assetfolderpath::Template() . 'images/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } else { $free = max($maximum - $used, 0); $res = '<img src="etc/lib/pChart2/zpanel/z3DPie.php?score=' . $free . '::' . $used . '&imagesize=240::190&chartsize=120::90&radius=100' . '&labels=Free: ' . $free . '::Used: ' . $used . '&legendfont=verdana&legendfontsize=8&legendsize=10::160"' . ' alt="' . ui_language::translate('Pie chart') . '"/>'; } return '<h2>' . ui_language::translate($name) . '</h2>' . $res; }
static function getMysqlUsagepChart() { global $controller; if (file_exists(ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png')) { return '<img src="' . ui_tpl_assetfolderpath::Template() . 'img/misc/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } else { return '<img src="modules/' . $controller->GetControllerRequest('URL', 'module') . '/assets/unlimited.png" alt="' . ui_language::translate('Unlimited') . '"/>'; } }