Commit ea852d64 authored by Clément Démoulins's avatar Clément Démoulins
Browse files

Fix PHP notices. Do not use uninitialized variables.

parent a4f2e72a
......@@ -165,7 +165,7 @@ HEADER;
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
function options_form()
......@@ -191,7 +191,11 @@ HEADER;
$form->add_new_line();
$filters = Array( "Connected Filtering", "Extension Value Based" );
$form->add_combobox_main_option("Filtering Method", "filtermode", $filters, $_POST["filtermode"], "", $onChange = "setFilterForm()");
$filtermode = "";
if (isset($_POST["filtermode"]))
$filtermode = $_POST["filtermode"];
$form->add_combobox_main_option("Filtering Method", "filtermode", $filters, $filtermode, "", $onChange = "setFilterForm()");
$form->add_value_option("Area ", "opt_a", "", $desc["area"]);
$form->add_value_option("Extinction ", "opt_e", "", $desc["extinction"]);
......
......@@ -162,7 +162,7 @@ SCRIPT;
return Array ( Array() );
}
protected function example_copyright_()
protected function example_copyright_($file)
{
return "";
}
......
......@@ -29,6 +29,7 @@ MENU;
// Handling index page entry.
$selected = "";
if ("index.php" == basename($_SERVER['PHP_SELF']))
$selected = "selected";
$output .= "<option value=\"index.php\"".$selected.">-- Select A Demo</option>";
......
......@@ -22,6 +22,7 @@ OUTPUT;
// Enable javascript zoom. It requires an image extension in the
// image url to work...
$z = "";
if ($zoom)
$z = "&.png";
......@@ -66,6 +67,7 @@ OUTPUT;
// Enable javascript zoom. It requires an image extension in the
// image url to work...
$z = "";
if ($zoom)
$z = "&.png";
......@@ -122,6 +124,7 @@ OUTPUT;
$space='50%';
$colspan='2';
$z = "";
if ($zoom)
$z = "&.png";
......
......@@ -26,7 +26,10 @@ class SessionManager
public function last_filename()
{
return $_SESSION['original_name_lastfile'];
if (isset($_SESSION['original_name_lastfile']))
return $_SESSION['original_name_lastfile'];
else
return "";
}
public function set_last_filename($name)
......@@ -51,7 +54,9 @@ class SessionManager
public function current_demo_id()
{
return $_SESSION['DEMO_ID'];
if (isset($_SESSION['DEMO_ID']))
return $_SESSION['DEMO_ID'];
return "";
}
public function has_current_demo()
......
......@@ -105,7 +105,7 @@ class RegionAdjacencyGraph extends DemoPage
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
function options_form()
......
......@@ -120,7 +120,7 @@ class SauvolaMs extends DemoPage
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
function options_form()
......
......@@ -173,7 +173,7 @@ class ShapeMorphology extends DemoPage
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
public function onload()
......
......@@ -162,7 +162,7 @@ class Example extends DemoPage
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
// Add some specifications on the input images.
......
......@@ -101,7 +101,7 @@ class TextDetectionInPics extends DemoPage
$res1 = "examples/$dir/results/{$file}_1.png";
$res2 = "examples/$dir/results/{$file}_2.png";
return render_image_result($this, $output, 'time_functor', $res1, $res2, false);
return render_image_result($this, $this->last_output, 'time_functor', $res1, $res2, false);
}
public function example_copyright_($file)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment