Required PHP extensions are not present in your mod_php/ISAPI PHP module. Please check your PHP setup to ensure you have the GD extension installed and enabled.

"; print "If you find that the weathermap tool itself is working, from the command-line or Cacti poller, then it is possible that you have two different PHP installations. The Editor uses the same PHP that webpages on your server use, but the main weathermap tool uses the command-line PHP interpreter.

"; print "Here is a copy of the phpinfo() from your PHP web module, to help debugging this...


"; phpinfo(); exit(); } if(isset($_REQUEST['action'])) { $action = $_REQUEST['action']; } if(isset($_REQUEST['mapname'])) { $mapname = $_REQUEST['mapname']; } if(isset($_REQUEST['selected'])) { $selected = $_REQUEST['selected']; } if($mapname == '') { // this is the file-picker/welcome page show_editor_startpage(); } else { // everything else in this file is inside this else $mapfile = $mapdir.'/'.$mapname; $map = new WeatherMap; $map->context = 'editor'; switch($action) { case 'newmap': $map->WriteConfig($mapfile); break; case 'font_samples': header('Content-type: image/png'); $im = imagecreate(250,imagefontheight(5)+5); $white = imagecolorallocate($im,255,255,255); $black = imagecolorallocate($im,0,0,0); $x = 3; for($i=1; $i< 6; $i++) { imagestring($im, $i, $x, 2, "Font $i", $black); $x = $x + imagefontwidth($i)*7; } imagepng($im); imagedestroy($im); exit(); break; case 'draw': header('Content-type: image/png'); $map->ReadConfig($mapfile); if($selected != '') { if(substr($selected,0,5) == 'NODE:') { $nodename = substr($selected,5); $map->nodes[$nodename]->selected=1; } if(substr($selected,0,5) == 'LINK:') { $linkname = substr($selected,5); $map->links[$linkname]->selected=1; } } $map->sizedebug = TRUE; // $map->RandomData(); $map->DrawMap(); exit(); break; case 'show_config': header('Content-type: text/plain'); $fd = fopen($mapfile,'r'); while (!feof($fd)) { $buffer = fgets($fd, 4096); echo $buffer; } fclose($fd); exit(); break; case "set_node_properties": $map->ReadConfig($mapfile); $node_name = $_REQUEST['node_name']; $new_node_name = $_REQUEST['node_new_name']; if($node_name != $new_node_name) { if(!isset($map->nodes[$new_node_name])) { // we need to rename the node first. $newnode = $map->nodes[$node_name]; $newnode->name = $new_node_name; $map->nodes[$new_node_name] = $newnode; unset($map->nodes[$node_name]); foreach ($map->links as $link) { if($link->a->name == $node_name) { $map->links[$link->name]->a = $newnode; } if($link->b->name == $node_name) { $map->links[$link->name]->b = $newnode; } } } else { // silently ignore attempts to rename a node to an existing name $new_node_name = $node_name; } } // by this point, and renaming has been done, and new_node_name will always be the right name $map->nodes[$new_node_name]->label = $_REQUEST['node_label']; $map->nodes[$new_node_name]->infourl = $_REQUEST['node_infourl']; $map->nodes[$new_node_name]->overliburl = $_REQUEST['node_hover']; if($_REQUEST['node_iconfilename'] == '--NONE--') { $map->nodes[$new_node_name]->iconfile=''; } else { $map->nodes[$new_node_name]->iconfile = stripslashes($_REQUEST['node_iconfilename']); } $map->WriteConfig($mapfile); break; case "set_link_properties": $map->ReadConfig($mapfile); $link_name = $_REQUEST['link_name']; $map->links[$link_name]->width = intval($_REQUEST['link_width']); $map->links[$link_name]->infourl = $_REQUEST['link_infourl']; $map->links[$link_name]->overliburl = $_REQUEST['link_hover']; // $map->links[$link_name]->target = $_REQUEST['link_target']; $targets = preg_split('/\s+/',$_REQUEST['link_target'],-1,PREG_SPLIT_NO_EMPTY); $new_target_list = array(); foreach ($targets as $target) { // we store the original TARGET string, and line number, along with the breakdown, to make nicer error messages later $newtarget = array($target,'traffic_in','traffic_out',0,$target); // if it's an RRD file, then allow for the user to specify the // DSs to be used. The default is traffic_in, traffic_out, which is // OK for Cacti (most of the time), but if you have other RRDs... if(preg_match("/(.*\.rrd):([\-a-zA-Z0-9_]+):([\-a-zA-Z0-9_]+)$/i",$target,$matches)) { $newtarget[0] = $matches[1]; $newtarget[1] = $matches[2]; $newtarget[2] = $matches[3]; } // now we've (maybe) messed with it, we'll store the array of target specs $new_target_list[] = $newtarget; } $map->links[$link_name]->targets = $new_target_list; $bwin = $_REQUEST['link_bandwidth_in']; $bwout = $_REQUEST['link_bandwidth_out']; if(isset($_REQUEST['link_bandwidth_out_cb']) && $_REQUEST['link_bandwidth_out_cb'] == 'symmetric') { $bwout = $bwin; } $map->links[$link_name]->SetBandwidth($bwin,$bwout); $map->WriteConfig($mapfile); break; case "set_map_properties": $map->ReadConfig($mapfile); $map->title = $_REQUEST['map_title']; $map->keytext['DEFAULT'] = $_REQUEST['map_legend']; $map->stamptext = $_REQUEST['map_stamp']; $map->htmloutputfile = $_REQUEST['map_htmlfile']; $map->imageoutputfile = $_REQUEST['map_pngfile']; $map->width = intval($_REQUEST['map_width']); $map->height = intval($_REQUEST['map_height']); // XXX sanitise this a bit if($_REQUEST['map_bgfile'] == '--NONE--') { $map->background=''; } else { $map->background = stripslashes($_REQUEST['map_bgfile']); } $oldlinkwidth = $map->defaultlink->width; $newlinkwidth = intval($_REQUEST['map_linkdefaultwidth']); $map->defaultlink->width = $newlinkwidth; // find all the links that have the old default width, and change them to the new default width // this is something that has bugged me for a while foreach ($map->links as $link) { if($link->width == $oldlinkwidth) { $map->links[$link->name]->width = $newlinkwidth; } } $bwin = $_REQUEST['map_linkdefaultbwin']; $bwout = $_REQUEST['map_linkdefaultbwout']; $map->defaultlink->SetBandwidth($bwin,$bwout); $map->WriteConfig($mapfile); break; case 'set_map_style': $map->ReadConfig($mapfile); $map->defaultlink->labelstyle = $_REQUEST['mapstyle_linklabels']; $map->htmlstyle = $_REQUEST['mapstyle_htmlstyle']; $map->defaultlink->arrowstyle = $_REQUEST['mapstyle_arrowstyle']; $map->defaultlink->bwfont = intval($_REQUEST['mapstyle_linkfont']); $map->defaultnode->labelfont = intval($_REQUEST['mapstyle_nodefont']); $map->keyfont = intval($_REQUEST['mapstyle_legendfont']); $map->WriteConfig($mapfile); break; case "add_link": $map->ReadConfig($mapfile); $param2 = $_REQUEST['param']; $newaction = 'add_link2'; $selected = 'NODE:'.$param2; break; case "add_link2": $map->ReadConfig($mapfile); $a = $_REQUEST['param2']; $b = $_REQUEST['param']; $log = "[$a -> $b]"; if($a != $b) { $newlink = new WeatherMapLink; $newlink->Reset($map); $newlink->a = $map->nodes[$a]; $newlink->b = $map->nodes[$b]; $newlink->SetBandwidth($map->defaultlink->max_bandwidth_in_cfg, $map->defaultlink->max_bandwidth_out_cfg); $newlink->width = $map->defaultlink->width; // make sure the link name is unique. We can have multiple links between // the same nodes, these days $newlinkname = "$a-$b"; while(array_key_exists($newlinkname,$map->links)) { $newlinkname .= "a"; } $newlink->name = $newlinkname; $map->links[$newlinkname] = $newlink; $map->WriteConfig($mapfile); } break; case "place_legend": $x = intval($_REQUEST['x']); $y = intval($_REQUEST['y']); $scalename = $_REQUEST['param']; $map->ReadConfig($mapfile); $map->keyx[$scalename] = $x; $map->keyy[$scalename] = $y; $map->WriteConfig($mapfile); break; case "place_stamp": $x = intval($_REQUEST['x']); $y = intval($_REQUEST['y']); $map->ReadConfig($mapfile); $map->timex = $x; $map->timey = $y; $map->WriteConfig($mapfile); break; case "move_node": $x = intval($_REQUEST['x']); $y = intval($_REQUEST['y']); $node_name = $_REQUEST['node_name']; $map->ReadConfig($mapfile); $map->nodes[$node_name]->x = $x; $map->nodes[$node_name]->y = $y; $map->WriteConfig($mapfile); break; case "add_node": $x = intval($_REQUEST['x']); $y = intval($_REQUEST['y']); $map->ReadConfig($mapfile); $node = new WeatherMapNode; $node->Reset($map); $node->x = snap($x); $node->y = snap($y); $node->name = "node".time(); $node->label = "NODE"; $map->nodes[$node->name] = $node; $map->WriteConfig($mapfile); break; case "delete_link": $map->ReadConfig($mapfile); $target = $_REQUEST['param']; $log = "delete link ".$target; unset($map->links[$target]); $map->WriteConfig($mapfile); break; case "delete_node": $map->ReadConfig($mapfile); $target = $_REQUEST['param']; $log = "delete node ".$target; foreach ($map->links as $link) { if( ($target == $link->a->name) || ($target == $link->b->name) ) { unset($map->links[$link->name]); } } unset($map->nodes[$target]); $map->WriteConfig($mapfile); break; // no action was defined - starting a new map? default: $map->ReadConfig($mapfile); break; } // now we'll just draw the full editor page, with our // new knowledge $imageurl = '?mapname='.$mapname . '&action=draw'; if($selected != '') { $imageurl .= '&selected='.$selected; } $imageurl .= '&unique='.time(); $imlist = get_imagelist("images") ?> PHP Weathermap Editor <?php echo $WEATHERMAP_VERSION; ?>
Weathermap

Debug: Do Nothing See config

DrawMap('null'); $map->htmlstyle='editor'; $map->PreloadMapHTML(); print $map->imap->subHTML("LEGEND:"); print $map->imap->subHTML("TIMESTAMP"); print $map->imap->subHTML("NODE:"); print $map->imap->subHTML("LINK:"); ?>
Node Properties
Internal Name
Label
Info URL
'Hover' Graph URL [Pick from Cacti] (not yet)
Icon Filename
 
Move NodeDelete Node
Helpful text will appear here, depending on the current item selected. It should wrap onto several lines, if it's necessary for it to do that.
Link Properties
Link from '%NODE1%' to '%NODE2%'
Maximum Bandwidth
Into '%NODE1%'
bits/sec
Maximum Bandwidth
Out of '%NODE1%'
Same As 'In' or bits/sec
Data Source [Pick from Cacti]
Link Width pixels
Info URL
'Hover' Graph URL
 
Delete Link
Map Properties
Map Title
Legend Text
Timestamp Text
Default Link Width pixels
Default Link Bandwidth bit/sec in, bit/sec out
Map Size x pixels
Output Image Filename
Output HTML Filename
Background Image Filename
Helpful text will appear here, depending on the current item selected. It should wrap onto several lines, if it's necessary for it to do that.
Map Style
Link Labels
HTML Style
Arrow Style
Node Font
Link Label Font
Legend Font
Font Samples:
(Drawn using your PHP install)
Helpful text will appear here, depending on the current item selected. It should wrap onto several lines, if it's necessary for it to do that.
Manage Colors
Nothing in here works yet. The aim is to have a nice color picker somehow.
Background Color
Link Outline Color
Scale Colors Some pleasant way to design the bandwidth color scale goes in here???
Helpful text will appear here, depending on the current item selected. It should wrap onto several lines, if it's necessary for it to do that.
Manage Images

Nothing in here works yet.

The aim is to have some nice way to upload images which can be used as icons or backgrounds. These images are what would appear in the dropdown boxes that don't currently do anything in the Node and Map Properties dialogs. This may end up being a seperate page rather than a dialog box...
Helpful text will appear here, depending on the current item selected. It should wrap onto several lines, if it's necessary for it to do that.
WebSVN - weathermap - Blame - Rev 7 - /editor.php
  jablonka.czprosek.czf

weathermap

Subversion Repositories:
[/] [editor.php] - Blame information for rev 7

 

Line No. Rev Author Line

Powered by WebSVN 2.2.1