function Show($which, $zoom, $detail) { global $pid, $eid, $uid, $TBSUEXEC_PATH, $TBADMINGROUP; global $template, $isadmin; $html = ""; if ($which == "vis") { if ($zoom == 0) { # Default is whatever we have; to avoid regen of the image. list($zoom, $detail) = $template->CurrentVisDetails(); } else { # Sanity check but lets not worry about throwing an error. if (!TBvalid_float($zoom)) { $zoom = 1.25; } if (!TBvalid_integer($detail)) { $detail = 1; } } ob_start(); $template->ShowVis($zoom, $detail); $html = ob_get_contents(); ob_end_clean(); $zoomout = sprintf("%.2f", $zoom / 1.25); $zoomin = sprintf("%.2f", $zoom * 1.25); $html .= "<button name=viszoomout type=button value={$zoomout}"; $html .= " onclick=\"VisChange('{$zoomout}', {$detail});\">"; $html .= "Zoom Out</button>\n"; $html .= "<button name=viszoomin type=button value={$zoomin}"; $html .= " onclick=\"VisChange('{$zoomin}', {$detail});\">"; $html .= "Zoom In</button>\n"; if ($detail) { $html .= "<button name=hidedetail type=button value=0"; $html .= " onclick=\"VisChange('{$zoom}', 0);\">"; $html .= "Hide Details</button>\n"; } else { $html .= "<button name=showdetail type=button value=1"; $html .= " onclick=\"VisChange('{$zoom}', 1);\">"; $html .= "Show Details</button>\n"; } } elseif ($which == "graph") { ob_start(); $template->ShowGraph(); $html = ob_get_contents(); ob_end_clean(); if (!$template->IsRoot()) { if ($template->IsHidden()) { $html .= "<button name=showtemplate type=button value=Show"; $html .= " onclick=\"GraphChange('showtemplate');\">"; $html .= "Show Template</button> "; } else { $html .= "<button name=hidetemplate type=button value=Hide"; $html .= " onclick=\"GraphChange('hidetemplate');\">"; $html .= "Hide Template</button> "; } $html .= "<input id=showexp_recursive type=checkbox value=Yep> "; $html .= "Recursive?         "; } $root = Template::LookupRoot($template->guid()); # We overload the hidden bit on the root. if ($root->IsHidden()) { $html .= "<button name=showhidden type=button value=showhidden"; $html .= " onclick=\"GraphChange('showhidden');\">"; $html .= "Show Hidden Templates</button>        "; } else { $html .= "<button name=hidehidden type=button value=hidehidden"; $html .= " onclick=\"GraphChange('hidehidden');\"> "; $html .= "Hide Hidden Templates</button>        "; } $html .= "<button name=zoomout type=button value=out"; $html .= " onclick=\"GraphChange('zoomout');\">Zoom Out</button>\n"; $html .= "<button name=zoomin type=button value=in"; $html .= " onclick=\"GraphChange('zoomin');\">Zoom In</button>\n"; # A delete button with a confirm box right there. if ($isadmin) { $html .= "<br><br>\n"; $html .= "<button name=deletetemplate type=button value=Delete"; $html .= " onclick=\"DeleteTemplate();\">"; $html .= "<font color=red>Delete</font></button> "; $html .= "<input id=confirm_delete type=checkbox value=Yep> "; $html .= "Confirm"; } } elseif ($which == "nsfile") { $nsdata = ""; $input_list = $template->InputFiles(); for ($i = 0; $i < count($input_list); $i++) { $nsdata .= htmlentities($input_list[$i]); $nsdata .= "\n\n"; } $html = "<pre><div align=left class=\"showexp_codeblock\">" . "{$nsdata}</div></pre>\n"; $html .= "<button name=savens type=button value=1"; $html .= " onclick=\"SaveNS();\">"; $html .= "Save</button>\n"; } return $html; }
while (list($index, $dbrow) = each($eventlist)) { $vname = $dbrow["vname"]; $time = $dbrow["time"]; $args = $dbrow["args"]; $delete_name = "delete_{$vname}"; $time_name = "time_{$vname}"; $args_name = "args_{$vname}"; # Delete button if (isset($formfields[$delete_name]) && $formfields[$delete_name] == "checked") { $deletes[$vname] = $vname; continue; } # Modify the time. if (isset($formfields[$time_name]) && $formfields[$time_name] != "{$time}") { $newtime = $formfields[$time_name]; if (!TBvalid_float($newtime)) { $errors["{$vname} time"] = TBFieldErrorString(); } elseif ($newtime < 0) { $errors["{$vname} time"] = "Cannot be less then zero"; } else { if (!isset($changes[$vname])) { $changes[$vname] = array(); } $changes[$vname]["time"] = $newtime; } } # Modify the arguments if (isset($formfields[$args_name]) && $formfields[$args_name] != "{$args}") { $newargs = $formfields[$args_name]; if (!TBcheck_dbslot($newargs, 'eventlist', 'arguments', TBDB_CHECKDBSLOT_WARN | TBDB_CHECKDBSLOT_ERROR)) { $errors["{$vname} time"] = TBFieldErrorString();