2009-07-16 09:54:58 +00:00
|
|
|
<?php
|
2009-09-01 20:25:18 +00:00
|
|
|
if(!isset($TOPDIR)) { $TOPDIR="..";}
|
2009-11-18 09:34:27 +00:00
|
|
|
require_once "$TOPDIR/lib/security.php";
|
|
|
|
require_once "$TOPDIR/lib/functions.php";
|
|
|
|
require_once "$TOPDIR/lib/display.php";
|
|
|
|
require_once "$TOPDIR/lib/monitor_display.php";
|
2009-08-19 09:12:58 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
displayMapper(array('home'=>'main.php', 'new_monitor' =>''));
|
2009-07-29 06:07:58 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
?>
|
2009-07-16 09:54:58 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(function() {
|
|
|
|
$(".pluginstat:first").toggleClass("ui-state-active");
|
|
|
|
$(".pluginstat").hover(
|
|
|
|
function() {
|
|
|
|
$(this).addClass("ui-state-hover");
|
|
|
|
},
|
|
|
|
function() {
|
|
|
|
$(this).removeClass("ui-state-hover");
|
|
|
|
}
|
|
|
|
);
|
|
|
|
$(".pluginstat").click(function(){
|
|
|
|
//TODO: only one plugin is allowedto be in active state
|
|
|
|
//There will be always only one div in active status
|
|
|
|
if($(this).hasClass('ui-state-active')==false) {
|
|
|
|
//find another div in active state, toggle it
|
2009-09-25 08:50:49 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
$(".pluginstat.ui-state-active").toggleClass("ui-state-active");
|
|
|
|
$(this).toggleClass("ui-state-active");
|
|
|
|
//then, update the contents in the "#settings" tab
|
|
|
|
var selected = $("#settings").tabs('option','selected');
|
|
|
|
var name = $(this).attr('id');
|
|
|
|
var options = ["desc","conf","view",["enable","disable"]];
|
|
|
|
if(selected != 3) {
|
|
|
|
$("#settings").tabs('url',selected,"monitor/options.php?name="+name+"&opt="+options[selected]);
|
|
|
|
}else {
|
|
|
|
//to handle enable/disable
|
|
|
|
var str = $(".ui-state-active .mid").html();
|
|
|
|
if(str.match("Enabled")==null) {
|
|
|
|
//the plugin is in "disabled" state, we need to enable it
|
|
|
|
$("#settings").tabs('url',3,"monitor/options.php?name="+name+"&opt="+options[3][0]);
|
|
|
|
}else {
|
|
|
|
$("#settings").tabs('url',3,"monitor/options.php?name="+name+"&opt="+options[3][1]);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$("#settings").tabs('load',selected);
|
|
|
|
}
|
|
|
|
});
|
2009-07-29 06:07:58 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
$("#settings").tabs({selected:-1});
|
|
|
|
$("#settings").tabs('option','ajaxOptions',{async:false});
|
|
|
|
$("#settings").bind('tabsselect', function(event, ui) {
|
|
|
|
var name=$('.ui-state-active').attr('id');
|
|
|
|
var options = ["desc","conf","view",["enable","disable"]];
|
|
|
|
var i;
|
|
|
|
for(i=0; i<options.length-1; i++) {
|
|
|
|
$("#settings").tabs("url", i, "monitor/options.php?name="+name+"&opt="+options[i]);
|
|
|
|
}
|
|
|
|
//to handle enable/disable
|
|
|
|
var str = $(".ui-state-active .mid").html();
|
|
|
|
if(str.match("Enabled")==null) {
|
|
|
|
//the plugin is in "disabled" state, we need to enable it
|
|
|
|
$("#settings").tabs('url',3,"monitor/options.php?name="+name+"&opt="+options[3][0]);
|
|
|
|
}else {
|
|
|
|
$("#settings").tabs('url',3,"monitor/options.php?name="+name+"&opt="+options[3][1]);
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
</script>
|
2009-08-19 09:12:58 +00:00
|
|
|
|
2009-11-18 09:34:27 +00:00
|
|
|
<div id="plist" class="ui-state-default ui-corner-all">
|
|
|
|
<?php displayMList(); ?>
|
|
|
|
</div>
|
|
|
|
<div id="settings">
|
|
|
|
<ul>
|
|
|
|
<li><a href="monitor/options.php">Description</a></li>
|
|
|
|
<li><a href="monitor/options.php">Configuration</a></li>
|
|
|
|
<li><a href="monitor/options.php">View</a></li>
|
|
|
|
<li><a href="monitor/options.php">Enable/Disable</a></li>
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
<div id="feedback"></div>
|