Modules: List view updates.
This commit is contained in:
parent
98ce23272a
commit
c34fbe9b4e
|
|
@ -306,7 +306,6 @@
|
|||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-action-start'],'title'=>$text['button-start'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('start'); list_form_submit('form_list')"]);
|
||||
echo " </td>\n";
|
||||
// echo " <td><a href='gateways.php?a=start&gateway=".urlencode($row["gateway_uuid"])."&profile=".urlencode($row["profile"])."' alt='".$text['label-action-start']."'>".$text['label-action-start']."</a></td>\n";
|
||||
}
|
||||
echo " <td> </td>\n";
|
||||
}
|
||||
|
|
@ -320,11 +319,10 @@
|
|||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-action-stop'],'title'=>$text['button-stop'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('stop'); list_form_submit('form_list')"]);
|
||||
echo " </td>\n";
|
||||
// echo " <td><a href='gateways.php?a=stop&gateway=".urlencode($row["gateway_uuid"])."&profile=".urlencode($row["profile"])."' alt='".$text['label-action-stop']."'>".$text['label-action-stop']."</a></td>\n";
|
||||
}
|
||||
echo " <td>".escape($state)."</td>\n"; //REGED, NOREG, UNREGED
|
||||
}
|
||||
catch(Exception $e) {
|
||||
catch (Exception $e) {
|
||||
//echo $e->getMessage();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -61,26 +61,6 @@ $text['title-module_add']['ru-ru'] = "Добавить Модуль";
|
|||
$text['title-module_add']['sv-se'] = "Lägg Till Modul";
|
||||
$text['title-module_add']['uk-ua'] = "Додавання модуля";
|
||||
|
||||
$text['label-unload_module']['en-us'] = "Unload Module";
|
||||
$text['label-unload_module']['ar-eg'] = "";
|
||||
$text['label-unload_module']['de-at'] = "Modul deaktivieren"; //copied from de-de
|
||||
$text['label-unload_module']['de-ch'] = "Modul deaktivieren"; //copied from de-de
|
||||
$text['label-unload_module']['de-de'] = "Modul deaktivieren";
|
||||
$text['label-unload_module']['es-cl'] = "Descargar Módulo";
|
||||
$text['label-unload_module']['es-mx'] = "Descargar Módulo"; //copied from es-cl
|
||||
$text['label-unload_module']['fr-ca'] = "Décharger le Module"; //copied from fr-fr
|
||||
$text['label-unload_module']['fr-fr'] = "Décharger le Module";
|
||||
$text['label-unload_module']['he-il'] = "";
|
||||
$text['label-unload_module']['it-it'] = "Disattiva Modulo";
|
||||
$text['label-unload_module']['nl-nl'] = "Module uitzetten";
|
||||
$text['label-unload_module']['pl-pl'] = "Wyłącz moduł";
|
||||
$text['label-unload_module']['pt-br'] = "Desativar Módulo";
|
||||
$text['label-unload_module']['pt-pt'] = "Desactivar Módulo";
|
||||
$text['label-unload_module']['ro-ro'] = "";
|
||||
$text['label-unload_module']['ru-ru'] = "Выгрузка Модулей";
|
||||
$text['label-unload_module']['sv-se'] = "Ladda av Modul";
|
||||
$text['label-unload_module']['uk-ua'] = "Вивантажити модуль";
|
||||
|
||||
$text['label-unknown']['en-us'] = "Unknown";
|
||||
$text['label-unknown']['ar-eg'] = "";
|
||||
$text['label-unknown']['de-at'] = "Unbekannt"; //copied from de-de
|
||||
|
|
@ -281,26 +261,6 @@ $text['label-message']['ru-ru'] = "Уведомление";
|
|||
$text['label-message']['sv-se'] = "Meddelande";
|
||||
$text['label-message']['uk-ua'] = "Повідомлення";
|
||||
|
||||
$text['label-load_module']['en-us'] = "Load Module";
|
||||
$text['label-load_module']['ar-eg'] = "";
|
||||
$text['label-load_module']['de-at'] = "Modul laden"; //copied from de-de
|
||||
$text['label-load_module']['de-ch'] = "Modul laden"; //copied from de-de
|
||||
$text['label-load_module']['de-de'] = "Modul laden";
|
||||
$text['label-load_module']['es-cl'] = "Cargar Módulo";
|
||||
$text['label-load_module']['es-mx'] = "Cargar Módulo"; //copied from es-cl
|
||||
$text['label-load_module']['fr-ca'] = "charger le Module"; //copied from fr-fr
|
||||
$text['label-load_module']['fr-fr'] = "charger le Module";
|
||||
$text['label-load_module']['he-il'] = "";
|
||||
$text['label-load_module']['it-it'] = "Attivare Modulo";
|
||||
$text['label-load_module']['nl-nl'] = "Module laden";
|
||||
$text['label-load_module']['pl-pl'] = "Włącz moduł";
|
||||
$text['label-load_module']['pt-br'] = "Carregar Módulo"; //copied from pt-pt
|
||||
$text['label-load_module']['pt-pt'] = "Carregar Módulo";
|
||||
$text['label-load_module']['ro-ro'] = "";
|
||||
$text['label-load_module']['ru-ru'] = "Загрузка Модулей";
|
||||
$text['label-load_module']['sv-se'] = "Ladda Modul";
|
||||
$text['label-load_module']['uk-ua'] = "Завантажити модуль";
|
||||
|
||||
$text['label-label']['en-us'] = "Label";
|
||||
$text['label-label']['ar-eg'] = "";
|
||||
$text['label-label']['de-at'] = "Kennzeichnung"; //copied from de-de
|
||||
|
|
@ -461,4 +421,84 @@ $text['error-event-socket']['ru-ru'] = "Подключение к сокету
|
|||
$text['error-event-socket']['sv-se'] = "Kontakten till 'Event Socket' misslyckades.";
|
||||
$text['error-event-socket']['uk-ua'] = "Помилка підключення до сокета подій";
|
||||
|
||||
?>
|
||||
$text['message-module_started']['en-us'] = "Module(s) Started";
|
||||
$text['message-module_started']['ar-eg'] = "";
|
||||
$text['message-module_started']['de-at'] = "Modul laden"; //copied from de-de
|
||||
$text['message-module_started']['de-ch'] = "Modul laden"; //copied from de-de
|
||||
$text['message-module_started']['de-de'] = "Modul laden";
|
||||
$text['message-module_started']['es-cl'] = "Cargar Módulo";
|
||||
$text['message-module_started']['es-mx'] = "Cargar Módulo"; //copied from es-cl
|
||||
$text['message-module_started']['fr-ca'] = "charger le Module"; //copied from fr-fr
|
||||
$text['message-module_started']['fr-fr'] = "charger le Module";
|
||||
$text['message-module_started']['he-il'] = "";
|
||||
$text['message-module_started']['it-it'] = "Attivare Modulo";
|
||||
$text['message-module_started']['nl-nl'] = "Module laden";
|
||||
$text['message-module_started']['pl-pl'] = "Włącz moduł";
|
||||
$text['message-module_started']['pt-br'] = "Carregar Módulo"; //copied from pt-pt
|
||||
$text['message-module_started']['pt-pt'] = "Carregar Módulo";
|
||||
$text['message-module_started']['ro-ro'] = "";
|
||||
$text['message-module_started']['ru-ru'] = "Загрузка Модулей";
|
||||
$text['message-module_started']['sv-se'] = "Ladda Modul";
|
||||
$text['message-module_started']['uk-ua'] = "Завантажити модуль";
|
||||
|
||||
$text['message-module_stopped']['en-us'] = "Module(s) Stopped";
|
||||
$text['message-module_stopped']['ar-eg'] = "";
|
||||
$text['message-module_stopped']['de-at'] = "Modul deaktivieren"; //copied from de-de
|
||||
$text['message-module_stopped']['de-ch'] = "Modul deaktivieren"; //copied from de-de
|
||||
$text['message-module_stopped']['de-de'] = "Modul deaktivieren";
|
||||
$text['message-module_stopped']['es-cl'] = "Descargar Módulo";
|
||||
$text['message-module_stopped']['es-mx'] = "Descargar Módulo"; //copied from es-cl
|
||||
$text['message-module_stopped']['fr-ca'] = "Décharger le Module"; //copied from fr-fr
|
||||
$text['message-module_stopped']['fr-fr'] = "Décharger le Module";
|
||||
$text['message-module_stopped']['he-il'] = "";
|
||||
$text['message-module_stopped']['it-it'] = "Disattiva Modulo";
|
||||
$text['message-module_stopped']['nl-nl'] = "Module uitzetten";
|
||||
$text['message-module_stopped']['pl-pl'] = "Wyłącz moduł";
|
||||
$text['message-module_stopped']['pt-br'] = "Desativar Módulo";
|
||||
$text['message-module_stopped']['pt-pt'] = "Desactivar Módulo";
|
||||
$text['message-module_stopped']['ro-ro'] = "";
|
||||
$text['message-module_stopped']['ru-ru'] = "Выгрузка Модулей";
|
||||
$text['message-module_stopped']['sv-se'] = "Ladda av Modul";
|
||||
$text['message-module_stopped']['uk-ua'] = "Вивантажити модуль";
|
||||
|
||||
$text['confirm-start_modules']['en-us'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['ar-eg'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['de-at'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['de-ch'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['de-de'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['es-cl'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['es-mx'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['fr-ca'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['fr-fr'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['he-il'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['it-it'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['nl-nl'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['pl-pl'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['pt-br'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['pt-pt'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['ro-ro'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['ru-ru'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['sv-se'] = "Are you sure you wish to START these modules?";
|
||||
$text['confirm-start_modules']['uk-ua'] = "Are you sure you wish to START these modules?";
|
||||
|
||||
$text['confirm-stop_modules']['en-us'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['ar-eg'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['de-at'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['de-ch'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['de-de'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['es-cl'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['es-mx'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['fr-ca'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['fr-fr'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['he-il'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['it-it'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['nl-nl'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['pl-pl'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['pt-br'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['pt-pt'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['ro-ro'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['ru-ru'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['sv-se'] = "Are you sure you wish to STOP these modules?";
|
||||
$text['confirm-stop_modules']['uk-ua'] = "Are you sure you wish to STOP these modules?";
|
||||
|
||||
?>
|
||||
|
|
@ -28,6 +28,7 @@
|
|||
include "root.php";
|
||||
require_once "resources/require.php";
|
||||
require_once "resources/check_auth.php";
|
||||
require_once "resources/paging.php";
|
||||
|
||||
//check permissions
|
||||
if (permission_exists('module_view')) {
|
||||
|
|
@ -42,58 +43,70 @@
|
|||
$language = new text;
|
||||
$text = $language->get();
|
||||
|
||||
//get includes and the title
|
||||
require_once "resources/header.php";
|
||||
$document['title'] = $text['title-modules'];
|
||||
require_once "resources/paging.php";
|
||||
//get posted data
|
||||
if (is_array($_POST['modules'])) {
|
||||
$action = $_POST['action'];
|
||||
$search = $_POST['search'];
|
||||
$modules = $_POST['modules'];
|
||||
}
|
||||
|
||||
//get the http values ans set as variables
|
||||
$order_by = $_GET["order_by"];
|
||||
$order = $_GET["order"];
|
||||
//toggle the modules
|
||||
if (permission_exists('module_edit')) {
|
||||
if ($action == 'toggle' && is_array($modules) && @sizeof($modules) != 0) {
|
||||
//toggle
|
||||
$obj = new modules;
|
||||
$obj->toggle($modules);
|
||||
//redirect
|
||||
header('Location: modules.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//start or stop a module
|
||||
//delete the modules
|
||||
if (permission_exists('module_delete')) {
|
||||
if ($action == 'delete' && is_array($modules) && @sizeof($modules) != 0) {
|
||||
//delete
|
||||
$obj = new modules;
|
||||
$obj->delete($modules);
|
||||
//redirect
|
||||
header('Location: modules.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
//connect to event socket
|
||||
$fp = event_socket_create($_SESSION['event_socket_ip_address'], $_SESSION['event_socket_port'], $_SESSION['event_socket_password']);
|
||||
if (strlen($_GET["a"]) > 0) {
|
||||
if ($_GET["a"] == "stop") {
|
||||
$module_name = $_GET["m"];
|
||||
if ($fp) {
|
||||
$cmd = "api unload $module_name";
|
||||
$response = trim(event_socket_request($fp, $cmd));
|
||||
$msg = "<strong>".$text['label-unload_module'].":</strong> <pre>".$response."</pre>";
|
||||
}
|
||||
|
||||
//control the modules
|
||||
if ($fp && is_array($modules) && @sizeof($modules) != 0) {
|
||||
if ($action == 'start') {
|
||||
//start
|
||||
$obj = new modules;
|
||||
$obj->start($modules);
|
||||
//redirect
|
||||
header('Location: modules.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
if ($_GET["a"] == "start") {
|
||||
$module_name = $_GET["m"];
|
||||
if ($fp) {
|
||||
$cmd = "api load $module_name";
|
||||
$response = trim(event_socket_request($fp, $cmd));
|
||||
$msg = "<strong>".$text['label-load_module'].":</strong> <pre>".$response."</pre>";
|
||||
}
|
||||
if ($action == 'stop') {
|
||||
//stop
|
||||
$obj = new modules;
|
||||
$obj->stop($modules);
|
||||
//redirect
|
||||
header('Location: modules.php'.($search != '' ? '?search='.urlencode($search) : null));
|
||||
exit;
|
||||
}
|
||||
header('Location: modules.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
//check connection status
|
||||
$esl_alive = false;
|
||||
if($fp){
|
||||
if ($fp) {
|
||||
$esl_alive = true;
|
||||
fclose($fp);
|
||||
}
|
||||
|
||||
//Warning if FS not start
|
||||
if(!$esl_alive){
|
||||
$msg = "<div align='center'>".$text['error-event-socket']."<br /></div>";
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='40%'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<th align='left'>".$text['label-message']."</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td class='row_style1'><strong>$msg</strong></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
//warn if switch not running
|
||||
if (!$fp) {
|
||||
message::add($text['error-event-socket'], 'negative', 5000);
|
||||
}
|
||||
|
||||
//use the module class to get the list of modules from the db and add any missing modules
|
||||
|
|
@ -101,155 +114,169 @@
|
|||
$module->db = $db;
|
||||
$module->dir = $_SESSION['switch']['mod']['dir'];
|
||||
$module->get_modules();
|
||||
$result = $module->modules;
|
||||
$module_count = count($result);
|
||||
$modules = $module->modules;
|
||||
$module_count = count($modules);
|
||||
$module->synch();
|
||||
$module->xml();
|
||||
$msg = $module->msg;
|
||||
|
||||
//show the msg
|
||||
if ($msg) {
|
||||
echo "<div align='center'>\n";
|
||||
echo "<table width='40%'>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<th align='left'>".$text['label-message']."</th>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td class='row_style1'>$msg</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "</div>\n";
|
||||
message::add($msg, 'negative', 5000);
|
||||
}
|
||||
|
||||
//create token
|
||||
$object = new token;
|
||||
$token = $object->create($_SERVER['PHP_SELF']);
|
||||
|
||||
//get includes and the title
|
||||
$document['title'] = $text['title-modules'];
|
||||
require_once "resources/header.php";
|
||||
|
||||
//show the content
|
||||
echo "<table width='100%' cellpadding='0' cellspacing='0' border='0'><tr>\n";
|
||||
echo "<td align='left' nowrap><b>".$text['header-modules']."</b></td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "<tr>\n";
|
||||
echo "<td align='left'>".$text['description-modules']."</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<div class='action_bar' id='action_bar'>\n";
|
||||
echo " <div class='heading'><b>".$text['header-modules']." (".$module_count.")</b></div>\n";
|
||||
echo " <div class='actions'>\n";
|
||||
if (permission_exists('module_edit') && $modules && $fp) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-stop'],'icon'=>$_SESSION['theme']['button_icon_stop'],'onclick'=>"if (confirm('".$text['confirm-stop_modules']."')) { list_action_set('stop'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
echo button::create(['type'=>'button','label'=>$text['button-start'],'icon'=>$_SESSION['theme']['button_icon_start'],'onclick'=>"if (confirm('".$text['confirm-start_modules']."')) { list_action_set('start'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo button::create(['type'=>'button','label'=>$text['button-refresh'],'icon'=>$_SESSION['theme']['button_icon_refresh'],'style'=>'margin-right: 15px;','link'=>'modules.php']);
|
||||
if (permission_exists('module_add')) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-add'],'icon'=>$_SESSION['theme']['button_icon_add'],'link'=>'module_edit.php']);
|
||||
}
|
||||
if (permission_exists('module_edit') && $modules) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-toggle'],'icon'=>$_SESSION['theme']['button_icon_toggle'],'onclick'=>"if (confirm('".$text['confirm-toggle']."')) { list_action_set('toggle'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
if (permission_exists('module_delete') && $modules) {
|
||||
echo button::create(['type'=>'button','label'=>$text['button-delete'],'icon'=>$_SESSION['theme']['button_icon_delete'],'onclick'=>"if (confirm('".$text['confirm-delete']."')) { list_action_set('delete'); list_form_submit('form_list'); } else { this.blur(); return false; }"]);
|
||||
}
|
||||
echo " </div>\n";
|
||||
echo " <div style='clear: both;'></div>\n";
|
||||
echo "</div>\n";
|
||||
|
||||
$c = 0;
|
||||
$row_style["0"] = "row_style0";
|
||||
$row_style["1"] = "row_style1";
|
||||
echo $text['description-modules']."\n";
|
||||
echo "<br /><br />\n";
|
||||
|
||||
echo "<table class='tr_hover' width='100%' border='0' cellpadding='0' cellspacing='0'>\n";
|
||||
$tmp_module_header = "\n";
|
||||
$tmp_module_header .= "<tr>\n";
|
||||
$tmp_module_header .= "<th>".$text['label-label']."</th>\n";
|
||||
$tmp_module_header .= "<th>".$text['label-status']."</th>\n";
|
||||
$tmp_module_header .= "<th>".$text['label-action']."</th>\n";
|
||||
$tmp_module_header .= "<th>".$text['label-enabled']."</th>\n";
|
||||
$tmp_module_header .= "<th>".$text['label-description']."</th>\n";
|
||||
$tmp_module_header .= "<td class='list_control_icons'>";
|
||||
$tmp_module_header .= "<a href='module_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
$tmp_module_header .= "</td>\n";
|
||||
$tmp_module_header .= "<tr>\n";
|
||||
echo "<form id='form_list' method='post'>\n";
|
||||
echo "<input type='hidden' id='action' name='action' value=''>\n";
|
||||
echo "<input type='hidden' name='search' value=\"".escape($search)."\">\n";
|
||||
|
||||
if ($module_count > 0) {
|
||||
$prev_module_category = '';
|
||||
foreach($result as $row) {
|
||||
if ($prev_module_category != $row["module_category"]) {
|
||||
$c=0;
|
||||
if (strlen($prev_module_category) > 0) {
|
||||
echo "<table class='list'>\n";
|
||||
function write_header($modifier) {
|
||||
global $fp, $text, $modules;
|
||||
$modifier = str_replace('/', '', $modifier);
|
||||
$modifier = str_replace(' ', ' ', $modifier);
|
||||
$modifier = str_replace(' ', '_', $modifier);
|
||||
$modifier = strtolower(trim($modifier));
|
||||
echo "\n";
|
||||
echo "<tr class='list-header'>\n";
|
||||
if (permission_exists('module_edit') || permission_exists('module_delete')) {
|
||||
echo " <th class='checkbox'>\n";
|
||||
echo " <input type='checkbox' id='checkbox_all_".$modifier."' name='checkbox_all_".$modifier."' onclick=\"list_all_toggle('".$modifier."');\" ".($modules ?: "style='visibility: hidden;'").">\n";
|
||||
echo " </th>\n";
|
||||
}
|
||||
echo "<th>".$text['label-label']."</th>\n";
|
||||
echo "<th class='hide-sm-dn'>".$text['label-status']."</th>\n";
|
||||
if ($fp) {
|
||||
echo "<th class='center'>".$text['label-action']."</th>\n";
|
||||
}
|
||||
echo "<th class='center'>".$text['label-enabled']."</th>\n";
|
||||
echo "<th class='hide-sm-dn' style='min-width: 40%;'>".$text['label-description']."</th>\n";
|
||||
if (permission_exists('module_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo "<td class='action-button'> </td>\n";
|
||||
}
|
||||
echo "</tr>\n";
|
||||
}
|
||||
if (is_array($modules) && @sizeof($modules) != 0) {
|
||||
$previous_category = '';
|
||||
foreach ($modules as $x => $row) {
|
||||
//write category and column headings
|
||||
if ($previous_category != $row["module_category"]) {
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='6'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='right'>\n";
|
||||
if (permission_exists('module_add')) {
|
||||
echo " <a href='module_edit.php' alt='add'>$v_link_label_add</a>\n";
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "<td colspan='7' class='no-link'>\n";
|
||||
echo ($previous_category != '' ? '<br />' : null)."<b>".$row["module_category"]."</b>";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
write_header($row["module_category"]);
|
||||
}
|
||||
echo "<tr><td colspan='4' align='left'>\n";
|
||||
echo " <br />\n";
|
||||
echo " <br />\n";
|
||||
echo " <b>".$row["module_category"]."</b> </td></tr>\n";
|
||||
echo $tmp_module_header;
|
||||
}
|
||||
|
||||
$tr_link = (permission_exists('module_edit')) ? "href='module_edit.php?id=".escape($row["module_uuid"])."'" : null;
|
||||
echo "<tr ".$tr_link.">\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if (permission_exists('module_edit')) {
|
||||
echo "<a href='module_edit.php?id=".escape($row["module_uuid"])."'>".escape($row["module_label"])."</a>";
|
||||
$list_row_url = "module_edit.php?id=".urlencode($row['module_uuid']);
|
||||
}
|
||||
echo "<tr class='list-row' href='".$list_row_url."'>\n";
|
||||
if (permission_exists('module_edit') || permission_exists('module_delete')) {
|
||||
$modifier = strtolower(trim($row["module_category"]));
|
||||
$modifier = str_replace('/', '', $modifier);
|
||||
$modifier = str_replace(' ', ' ', $modifier);
|
||||
$modifier = str_replace(' ', '_', $modifier);
|
||||
echo " <td class='checkbox'>\n";
|
||||
echo " <input type='checkbox' name='modules[$x][checked]' id='checkbox_".$x."' class='checkbox_".$modifier."' value='true' onclick=\"if (!this.checked) { document.getElementById('checkbox_all_".$modifier."').checked = false; }\">\n";
|
||||
echo " <input type='hidden' name='modules[$x][uuid]' value='".escape($row['module_uuid'])."' />\n";
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo " <td>";
|
||||
if (permission_exists('module_edit')) {
|
||||
echo "<a href='".$list_row_url."' title=\"".$text['button-edit']."\">".escape($row['module_label'])."</a>";
|
||||
}
|
||||
else {
|
||||
echo $row["module_label"];
|
||||
echo escape($row['module_label']);
|
||||
}
|
||||
echo " </td>\n";
|
||||
if($esl_alive) {
|
||||
if ($fp) {
|
||||
if ($module->active($row["module_name"])) {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-running']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=stop&m=".escape($row["module_name"])."' alt='".$text['label-stop']."'>".$text['label-stop']."</a></td>\n";
|
||||
echo " <td class='hide-sm-dn'>".$text['label-running']."</td>\n";
|
||||
if (permission_exists('module_edit')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-stop'],'title'=>$text['button-stop'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('stop'); list_form_submit('form_list')"]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
}
|
||||
else {
|
||||
if ($row['module_enabled']=="true") {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><b>".$text['label-stopped']."</b></td>\n";
|
||||
echo " <td class='hide-sm-dn'>\n";
|
||||
echo $row['module_enabled'] == 'true' ? "<strong style='color: red;'>".$text['label-stopped']."</strong>" : $text['label-stopped']." ".escape($notice);
|
||||
echo " </td>\n";
|
||||
if (permission_exists('module_edit')) {
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-start'],'title'=>$text['button-start'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('start'); list_form_submit('form_list')"]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
else {
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-stopped']." ".escape($notice)."</td>\n";
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'><a href='modules.php?a=start&m=".escape($row["module_name"])."' alt='".$text['label-start']."'>".$text['label-start']."</a></td>\n";
|
||||
}
|
||||
}
|
||||
else{
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-unknown']."</td>\n";
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>".$text['label-none']."</td>\n";
|
||||
echo " <td class='hide-sm-dn'>".$text['label-unknown']."</td>\n";
|
||||
}
|
||||
echo " <td valign='top' class='".$row_style[$c]."'>";
|
||||
if ($row["module_enabled"] == "true") {
|
||||
echo $text['option-true'];
|
||||
}
|
||||
else if ($row["module_enabled"] == "false") {
|
||||
echo $text['option-false'];
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo " <td valign='top' class='row_stylebg'>".escape($row["module_description"])." </td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('module_edit')) {
|
||||
echo "<a href='module_edit.php?id=".escape($row["module_uuid"])."' alt='".$text['button-edit']."'>$v_link_label_edit</a>";
|
||||
echo " <td class='no-link center'>";
|
||||
echo button::create(['type'=>'submit','class'=>'link','label'=>$text['label-'.$row['module_enabled']],'title'=>$text['button-toggle'],'onclick'=>"list_self_check('checkbox_".$x."'); list_action_set('toggle'); list_form_submit('form_list')"]);
|
||||
}
|
||||
if (permission_exists('module_delete')) {
|
||||
echo "<a href='module_delete.php?id=".escape($row["module_uuid"])."' alt='".$text['button-delete']."' onclick=\"return confirm('".$text['confirm-delete']."')\">$v_link_label_delete</a>";
|
||||
else {
|
||||
echo " <td class='center'>";
|
||||
echo $text['label-'.$row['module_enabled']];
|
||||
}
|
||||
echo " </td>\n";
|
||||
echo " <td class='description overflow hide-sm-dn'>".escape($row["module_description"])." </td>\n";
|
||||
if (permission_exists('module_edit') && $_SESSION['theme']['list_row_edit_button']['boolean'] == 'true') {
|
||||
echo " <td class='action-button'>";
|
||||
echo button::create(['type'=>'button','title'=>$text['button-edit'],'icon'=>$_SESSION['theme']['button_icon_edit'],'link'=>$list_row_url]);
|
||||
echo " </td>\n";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
|
||||
$prev_module_category = $row["module_category"];
|
||||
$c = $c ? 0 : 1;
|
||||
$previous_category = $row["module_category"];
|
||||
|
||||
$x++;
|
||||
}
|
||||
unset($sql, $modules, $row_count);
|
||||
}
|
||||
unset($modules);
|
||||
|
||||
echo "<tr>\n";
|
||||
echo "<td colspan='6'>\n";
|
||||
echo " <table width='100%' cellpadding='0' cellspacing='0'>\n";
|
||||
echo " <tr>\n";
|
||||
echo " <td width='33.3%' nowrap> </td>\n";
|
||||
echo " <td width='33.3%' align='center' nowrap>$paging_controls</td>\n";
|
||||
echo " <td class='list_control_icons'>";
|
||||
if (permission_exists('module_add')) {
|
||||
echo "<a href='module_edit.php' alt='".$text['button-add']."'>$v_link_label_add</a>";
|
||||
}
|
||||
echo "</td>\n";
|
||||
echo " </tr>\n";
|
||||
echo " </table>\n";
|
||||
echo "</td>\n";
|
||||
echo "</tr>\n";
|
||||
echo "</table>\n";
|
||||
echo "<br />\n";
|
||||
|
||||
echo "</table>";
|
||||
echo "<br><br>";
|
||||
echo "<input type='hidden' name='".$token['name']."' value='".$token['hash']."'>\n";
|
||||
|
||||
//show the footer
|
||||
echo "</form>\n";
|
||||
|
||||
//include the footer
|
||||
require_once "resources/footer.php";
|
||||
|
||||
?>
|
||||
?>
|
||||
File diff suppressed because it is too large
Load Diff
|
|
@ -411,21 +411,35 @@ echo "<script language='JavaScript' type='text/javascript' src='<!--{project_pat
|
|||
}
|
||||
|
||||
//list functions
|
||||
function list_all_toggle() {
|
||||
function list_all_toggle(modifier) {
|
||||
var inputs = document.getElementsByTagName('input');
|
||||
var checkbox_checked = document.getElementById('checkbox_all').checked;
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = checkbox_checked;
|
||||
}
|
||||
}
|
||||
if (checkbox_checked) {
|
||||
document.getElementById('btn_check_all').style.display = 'none';
|
||||
document.getElementById('btn_check_none').style.display = '';
|
||||
if (modifier !== undefined) {
|
||||
var checkbox_checked = document.getElementById('checkbox_all_'+modifier).checked;
|
||||
}
|
||||
else {
|
||||
document.getElementById('btn_check_all').style.display = '';
|
||||
document.getElementById('btn_check_none').style.display = 'none';
|
||||
var checkbox_checked = document.getElementById('checkbox_all').checked;
|
||||
}
|
||||
for (var i = 0, max = inputs.length; i < max; i++) {
|
||||
if (modifier !== undefined) {
|
||||
if (inputs[i].type === 'checkbox' && inputs[i].className === 'checkbox_'+modifier) {
|
||||
inputs[i].checked = checkbox_checked;
|
||||
}
|
||||
}
|
||||
else {
|
||||
if (inputs[i].type === 'checkbox') {
|
||||
inputs[i].checked = checkbox_checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (document.getElementById('btn_check_all') && document.getElementById('btn_check_none')) {
|
||||
if (checkbox_checked) {
|
||||
document.getElementById('btn_check_all').style.display = 'none';
|
||||
document.getElementById('btn_check_none').style.display = '';
|
||||
}
|
||||
else {
|
||||
document.getElementById('btn_check_all').style.display = '';
|
||||
document.getElementById('btn_check_none').style.display = 'none';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue