Portions created by the Initial Developer are Copyright (C) 2008-2012 the Initial Developer. All Rights Reserved. Contributor(s): Mark J Crane */ include "root.php"; require_once "resources/require.php"; require_once "resources/check_auth.php"; if (permission_exists('modules_view')) { //access granted } else { echo "access denied"; exit; } //add multi-lingual support require_once "app_languages.php"; foreach($text as $key => $value) { $text[$key] = $value[$_SESSION['domain']['language']['code']]; } require_once "includes/header.php"; $page["title"] = $text['title-modules']; require_once "includes/paging.php"; $order_by = $_GET["order_by"]; $order = $_GET["order"]; $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 = "".$text['label-unload_module'].":
".$response."
"; } } if ($_GET["a"] == "start") { $module_name = $_GET["m"]; if ($fp) { $cmd = "api load $module_name"; $response = trim(event_socket_request($fp, $cmd)); $msg = "".$text['label-load_module'].":
".$response."
"; } } } //use the module class to get the list of modules from the db and add any missing modules require_once "includes/classes/switch_modules.php"; $mod = new switch_modules; $mod->db = $db; $mod->dir = $_SESSION['switch']['mod']['dir']; $mod->get_modules(); $result = $mod->modules; $module_count = count($result); $mod->synch(); $msg = $mod->msg; //show the msg if ($msg) { save_module_xml(); echo "
\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-message']."
$msg
\n"; echo "
\n"; } //show the content echo "
"; echo "\n"; echo "\n"; echo " "; echo ""; echo "
\n"; echo "
"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "
".$text['header-modules']."
".$text['description-modules']."
\n"; $c = 0; $row_style["0"] = "row_style0"; $row_style["1"] = "row_style1"; echo "
\n"; echo "\n"; $tmp_module_header = "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\n"; $tmp_module_header .= "\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 "\n"; echo "\n"; echo "\n"; } echo "\n"; echo $tmp_module_header; } echo "\n"; echo " \n"; echo " \n"; if ($mod->active($row["module_name"])) { echo " \n"; echo " \n"; } else { if ($row['module_enabled']=="true") { echo " \n"; } else { echo " \n"; } echo " \n"; } echo " \n"; echo " \n"; echo "\n"; $prev_module_category = $row["module_category"]; if ($c==0) { $c=1; } else { $c=0; } } //end foreach unset($sql, $modules, $row_count); } //end if results echo "\n"; echo "\n"; echo "\n"; echo "
".$text['label-label']."".$text['label-description']."".$text['label-status']."".$text['label-action']."".$text['label-enabled']."\n"; $tmp_module_header .= " $v_link_label_add\n"; $tmp_module_header .= "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
  \n"; if (permission_exists('modules_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
\n"; echo "
\n"; echo "
\n"; echo " ".$row["module_category"]." 
".$row["module_label"]."".$row["module_description"]." ".$text['label-running']."".$text['label-stop']."".$text['label-stopped']."".$text['label-stopped']." ".$notice."".$text['label-start'].""; if ($row["module_enabled"] == "true") { echo $text['option-true']; } else if ($row["module_enabled"] == "false") { echo $text['option-false']; } echo "\n"; if (permission_exists('modules_edit')) { echo " $v_link_label_edit\n"; } if (permission_exists('modules_delete')) { echo " $v_link_label_delete\n"; } echo "
\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; echo "
 $paging_controls\n"; if (permission_exists('modules_add')) { echo " $v_link_label_add\n"; } echo "
\n"; echo "
"; echo "
"; echo "

"; echo "

"; echo "
"; echo "
"; echo "

"; //show the footer require_once "includes/footer.php"; ?>